安装python3.7后,pip在安装包的过程中出现“pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.”错误。在安装openssl-devel,openssl后重新编译python3.7均无法运行pip,则需要更新openssl版本为1.1.1k,以下为安装过程。
1、下载安装openssl
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz
tar -zxvf openssl-1.1.1k.tar.gz
cd openssl-1.1.1k
./config --prefix=/usr/local/openssl no-zlib
make
make install
2、备份原openssl
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl/ /usr/include/openssl.bak
3、建立openssl1.1.1k软连接
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/local/lib64/libssl.so
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
4、openssl库文件配置搜索
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v #使修改后的/etc/ld.so.conf生效
5、重新安装python
cd Python-3.7.0
./configure --with-openssl=/usr/local/openssl
make
make install
6、结束
至此pip已经可以正常运行了,继续进行下部操作即可。
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
test
test
test
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh
jfgh