python3.7 pip安装类库报错:ssl module in Python is not available

[root@10-23-67-69 Python-3.7.0]# python3
Python 3.4.8 (default, Apr  9 2018, 11:43:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> 这里导入ssl成功,没有报错

[root@10-23-67-69 Python-3.7.0]# pip3 install numpy 这里安装numpy报没有ssl模块
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/

怎么处理才能让pip安装类库不报错?

largeQ
浏览 7237回答 5
5回答

慕的地8271018

pip3 install openssl试下

至尊宝的传说

检查一下第一步的 python3.4.8 与第二步的 pip3 是否在同一个 py 环境。

守着星空守着你

操作系统需要安装一下ssl,比如centos yum install openssl* -y
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python