pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
提示
Collecting pip 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/pip/ 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/pip/ Retrying (Retry(total=2, 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/pip/
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
python3 提示ssl错误
提示:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/python3/lib/python3.6/ssl.py", line 101, in <module> import _ssl # if we can't import it, let the error propagate ModuleNotFoundError: No module named '_ssl'
解决方法:
重新编译python3,在编译的时候加上ssl参数
进入源码目录,然后输入以下命令 ` ./configure --with-ssl make & make install
` 以上都不能解决的话,先安装这两个软件
yum install openss openssl-devel -y
然后在重新编译安装才生效
./configure --with-ssl
make & make install
./configure --with-ssl
make & make install