添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
奔跑的香烟  ·  Building APIs using ...·  10 小时前    · 
发怒的弓箭  ·  gz文件如何用python解压 | ...·  8 小时前    · 
高大的茄子  ·  廖波 - 搜狗百科·  1 月前    · 
拉风的黄瓜  ·  Issues to install ...·  2 月前    · 
玩足球的包子  ·  Tailwind @Apply: ...·  2 月前    · 
爱旅游的长颈鹿  ·  Openwrt 下 Docker ...·  2 月前    · 

Python之——pip is configured with locations that require TLS/SSL, however the ssl module in Python

问题:

安装Python后,使用pip命令安装Python库,报错,如下:

$ pip install numpy
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

解决方案:

命令行执行如下命令:

yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel zlib* libffi-devel readline-devel tk-devel

执行命令后,重新安装Python,如下:

cd python安装文件目录
make clean
make
make install

如果再不行,就升级openssl。

升级openssl

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

2.编译安装

./config --prefix=/usr/local/openssl no-zlib #不需要zlib
make
make install

3.备份原配置

mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl/ /usr/include/openssl.bak

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

5.修改系统配置

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

6.查看openssl版本

openssl version

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

假如你的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

7.重新安装python

cd python安装文件目录
make clean
./configure --with-openssl=/usr/local/openssl
make
make install



pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

解决办法: brew update && brew upgrade brew uninstall --ignore-dependencies openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail

安装模块的时候,报错:pip is configured with locations that require TLS/SSL, however t=None, read=None, redirect=No...

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

爬虫时遇到的问题安装requests库出错: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. 解决方法:windos系统下: 在只安装Anaconda 想要在命令行里用pip安装一些爬虫必要的库时,出现报错解决方法:

成功解决WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python

成功解决WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.目录解决问题解决思路解决方法解决问题WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in ...

【解决pip不可用】windows/linux下python3pip is configured with locations that require TLS/SSL, however the..

文章目录路人神对话——导火索路人提醒问题linux环境下解决路人神对话——导火索大兄der长点心吧hhh主要原因网速慢别着急路人提醒路人甲WINDOWS系统,就点击上面WINDOWS环境下的网址,下载那个64位MSI,我下载到的python运行的环境(你就当你的PYTHON运行程序的安装目录就行),虽然安装是英文,但是一直选默认就行,最后有个美元的四选一,我选的第二个没有...