centos7安裝python3.7.2后,運行
pip3 install tornado
會報錯
[root@localhost ~]# pip3 install tornado
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting tornado 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/tornado/ 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/tornado/ 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/tornado/ Retrying (Retry(total=1, 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/tornado/ Retrying (Retry(total=0, 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/tornado/ Could not fetch URL https://pypi.org/simple/tornado/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/tornado/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping Could not find a version that satisfies the requirement tornado (from versions: ) No matching distribution found for tornado 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
解決方法:
在./configure過程中,如果沒有加上–with-ssl參數時,默認安裝的軟件涉及到ssl的功能不可用,
剛好pip3過程需要ssl模塊,而由於沒有指定,所以該功能不可用。
-
查看openssl安裝包,發現缺少openssl-devel包
[root@localhost ~]# rpm -aq|grep openssl openssl-0.9.8e-20.el5 openssl-0.9.8e-20.el5 [root@localhost ~]#
-
yum安裝openssl-devel
[root@localhost ~]# yum install openssl-devel -y
查看安裝結果[root@localhost ~]# rpm -aq|grep openssl openssl-0.9.8e-26.el5_9.1 openssl-0.9.8e-26.el5_9.1 openssl-devel-0.9.8e-26.el5_9.1 openssl-devel-0.9.8e-26.el5_9.1
-
重新對python3.7.2進行編譯安裝,用以下過程來實現編譯安裝
cd Python-3.7.2
./configure --with-ssl
make
sudo make install
參考:
https://blog.csdn.net/zhengcaihua0/article/details/79681991