python 使用pip 安裝模塊是提示SSL錯誤
出現該問題的原因由於系統的openssl是1.0.1的版本,對於python3.7太老了,需要更新為openssl1.0.2或者libressl2.64(不含)以后的版本,所以這里從libressl官網下載libressl源碼,編譯生成庫文件代替系統的openssl1.0.1
安裝SSL:
./config --prefix=/usr/local/ssl
make && make install
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
安裝完成后確定openssl 版本
openssl version
安裝python
./configure --prefix=/usr/python --with-ssl --enable-shared CFLAGS=-fPIC
make && make install
ln -s /usr/python/bin/python /usr/bin/python
ln -s /usr/python/bin/pip3 /usr/bin/pip3
確定ssl 模塊
成功加載則安裝成功