centos6 安裝python3.7相關問題

1.使用pip報錯
報錯信息:
Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: Can’t connect to HTTPS URL because the SSL module is not available. - skipping
解決方法:
修改安裝目錄下 Modules/Setup如下部分信息爲:
.# Socket module helper for SSL support; you must comment out the other
.# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c
-DUSE_SSL -I(SSL)/includeI(SSL)/include -I(SSL)/include/openssl
-L$(SSL)/lib -lssl -lcrypto

2.使用make cache後重新編譯make&&make install報錯:
error “libssl is too old and does not support X509_VERIFY_PARAM_set1_host()”
解決方法:
下載ssl安裝包進行安裝
wget https://www.openssl.org/source/openssl-1.1.0l.tar.gz
tar openssl-1.1.01.tar.gz
cd openssl-1.1.01
./config shared zlib-dynamic
make&&make install
備份原有openssl
mv /usr/bin/openssl /usr/bin/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl

3.如報錯爲ibcrypto.so.1.0.01: cannot open shared object file: No such file or directory
#配置lib的軟連接
ln -s /usr/local/ssl/lib/libssl.so /usr/lib/libssl.so.1.0.01
ln -s /usr/local/ssl/lib/libcrypto.so /usr/lib/libcrypto.so.1.0.01

4.重新編譯python3.7
make clean&&make&&make install

5.測試
pytho3
import ssl
如果不報錯則安裝正確

參考:
https://blog.csdn.net/jellocomeon/article/details/96913663
https://blog.csdn.net/yifeng20xx/article/details/74896426

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章