当前位置:   article > 正文

python 安装: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in

pip is configured with locations that require tls/ssl, however the ssl modul

python 安装: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

系统CENTOS6.10,安装Python3时遇到了如下问题,在CENTOS7系统上安装时未遇到上述问题。

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  • 1

感谢狐狸已妖化提供的解决方案
##解决方案如下

1、原因

系统版本centos6.10,其中openssl的版本为OpenSSL 1.0.1e-fips 11 Feb 2013,而python3.7需要的openssl的版本为1.0.2或者1.1.x,需要对openssl进行升级,并重新编译python3.7.0。yum 安装的openssl 版本都比较低。

2、升级openssl

2.1下载openssl
wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
tar -zxvf openssl-1.1.1a.tar.gz
cd openssl-1.1.1a
  • 1
  • 2
  • 3
2.2 编译安装
./config --prefix=/usr/local/openssl no-zlib #不需要zlib
make
make install
  • 1
  • 2
  • 3
2.3 备份原配置
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl/ /usr/include/openssl.bak
  • 1
  • 2

2.4 新版配置

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
  • 1
  • 2
  • 3

2.5 修改系统配置

## 写入openssl库文件的搜索路径
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
## 使修改后的/etc/ld.so.conf生效 
ldconfig -v
  • 1
  • 2
  • 3
  • 4

6.查看openssl版本

openssl version
  • 1
openssl version 提示:

 /usr/local/openssl/bin/openssl: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
  • 1
  • 2
  • 3

假如你的libssl.so.1.1 文件在/usr/local/openssl/lib/下面,可以这样做

ln -s /usr/local/openssl/lib/libssl.so.1.1 /usr/lib64/libssl.so.1.1

ln -s /usr/local/openssl/lib/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
  • 1
  • 2
  • 3

然后重新安装Python3

./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl
make
make install
  • 1
  • 2
  • 3
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/423633
推荐阅读
相关标签
  

闽ICP备14008679号