编译安装完python3.10后,pip不能使用!
出现报错: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not ...网上文章说在configure这一步上加上--with openssl:
./configure --prefix=/usr/local/python3 --with-openssl=/usr/bin/openssl
但是问题没有解决,用yum进行更新openssl也不行,再编译python3.10也还是报错。
问题解决:下载openssl包,重新安装openssl:
#下载openssl包: wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz #解压: tar -xvf OpenSSL_1_1_1d.tar.gz -C . #编译安装: cd OpenSSL_1_1_1d .confiugre --prefix=/usr/local/openssl && make && make install
在安装过程中,时间略长。
打开/usr/local/bin/openssl再次报错: openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory 问题解决:查看在安装的openssl的lib文件夹里有无有如下的库文件:libcrypto.so.11和libssl.so.1.1
为其建立软连接:
再次打开/usr/local/openssl/bin/openssl ,成功进入!
比较旧版和新版openssl的版本号:
对旧版openssl进行保存或删除重新安装编译python3.10
#下载源码包: wget https://www.python.org/ftp/python/3.10.4/Python-3.10.4.tgz #解压: tar -xvf P* #编译安装: cd P*4 configure --prefix=/usr/local/python3.10 --with-openssl=/usr/local/openssl make && make install更新pip3.10
删除源码包,也可以保存
#删除openssl源码包: rm -Rf O* rm -Rf o* #删除Python源码包: rm -Rf P*



