相关文章推荐
豪爽的萝卜  ·  Type conversions and ...·  1 年前    · 
发怒的红烧肉  ·  Gitlab ...·  1 年前    · 
解决pip is configured with locations that require TLS/SSL, however the ssl module in Python is not ... 2022-09-15 23:33:57

openssl 官方下载地址: https://www.openssl.org/source/

wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz
tar -zxvf OpenSSL_1_1_1d.tar.gz

二、编译安装

进入openssl-OpenSSL_1_1_1d

cd  openssl-OpenSSL_1_1_1d

指定安装路径并编译

./config --prefix=/usr/local/openssl // 指定安装路径
make && make install

三、替换当前系统的旧版本 openssl 「先保存原来的」

mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/lib64/openssl /usr/lib64/openssl.old
mv /usr/lib64/libssl.so /usr/lib64/libssl.so.old
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/lib/libssl.so /usr/lib64/libssl.so
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v // 建立动态链接

四、最后查看当前系统 openssl 版本

openssl version

五、重新编译Python3.7

进入解压后的Python目录

cd Python-3.7.1
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl
make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
                                    最近在Ubuntu16.04上安装Python3.6之后,使用pip命令出现了问题,提示说找不到ssl模块,出现错误如下:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https:*******: There was a problem confirming the ssl certificate:
Can't connect to HTTPS URL because the SSL m
                                    在使用pip3的时候,错误信息如下:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
网上的方法都是在CentOS下进行的,而我用的是Deepin系统,也就是基于Ubuntu/Debian的发行版。
而且网上的某些方法用./configure –with-ssl这条命令是无效的,下面给出解决问题的方案。
出现这种错误可以在Modules/Setup中,Ctrl + F查找字符串SSL,
将找到的第一个SSL下面的命
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
使用pip提示找不到ssl模块。
而且,在python shell import ssl同样提示找不到ssl模块。
今天查阅了很多资料,终于解决了:
1.使用rpm -aq|grep openssl命令查询openssl是否正确安装。发现缺少openssl-devel
[root@centos68 insight-tool]# pip3 --version
pip 10.0.1 from /usr/local/python3.7/lib/python3.7/site-packages/pip (python 3.7)
[root@centos68 insight-tool]# pip3 install -r requirement.txt 
                                    Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
                                    已解决pip升级报错)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: pip in e:\anaconda\install_root\lib\
                                    解决执行pip3 install numpy时,报pip is configured with locations that require TLS/SSL问题
                                    root@OpenWrt:/tmp# python get-pip.py
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future...
最近给服务器安装python环境,通过源码方式安装Python3.8之后,使用pip功能出现异常,提示
[root@localhost ~]# pip3 install you-get
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting httpbin
  Retrying (Retry(total=4, conn
                                    首先要明白python版本需要和openssl的版本需要相对匹配的,在Python3.7之后的版本,依赖的openssl,必须要是1.1或者1.0.2之后的版本,或者安装了2.6.4之后的libressl,`linux自带的openssl版本过低`。
                                    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