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

简介: # 背景 安装pip后发现执行pip install pytest,提示下面错误 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

# 背景

安装pip后发现执行pip install pytest,提示下面错误

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

 

# 解决方法

查询了资料,大概意思是,新版的pip默认要使用SSL,可以通过设置修改,但木有发现pip.conf文件在哪里,囧rz,后续再研究下

但找到另外一个解决方法

先安装openssl-dev,然后重新编译安装,只是在编译的过程中加入 --enable-optimizations

具体如下:

sudo yum install openssl-devel

然后:
./configure --enable-optimizations
make && make install

这样就可以了的 

 

实际上解决方法挺多的

1. 修改pip.conf

2. 修改安装目录下module下的setup文件

3. 安装openssl后,编译时加上--enable-optimizations

虽千万人,吾往矣!
目录
相关文章
|
Python
python2 pip2 No module named web
python2 pip2 No module named web
111 0
|
网络安全 开发工具 Python
【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
115 1
|
数据采集 网络安全 Python
Python使用urllib或者urllib2模块打开网页遇到ssl报错
Python使用urllib或者urllib2模块打开网页遇到ssl报错
266 0
|
Linux 网络安全 开发者
【Python】已解决:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module i
【Python】已解决:WARNING: pip is configured with locations that require TLS/SSL, however the ssl module i
4538 3
|
网络安全 API Python
Python下载大文件时遇到了SSL握手失败,要怎么办?
在 Python 数据集下载中常遇程序中断问题, 如网络不稳定、API请求数量限制等。网络不稳定时可通过实现重试机制与使用短效代理IP应对。示例代码利用 `requests` 库实现自动重试功能,提高下载成功率。对于 API 请求数量限制,可通过控制请求速率和轮换代理IP解决。示例展示了如何控制请求间隔及使用代理池轮换来避免触发限制。这些技巧有助于确保下载任务的顺利进行。
|
域名解析 安全 网络安全
使用Python自动检测SSL证书是否过期
使用Python自动检测SSL证书是否过期
504 0
|
网络安全 Python
Conda/Python更新失败:SSL错误
Conda/Python更新失败:SSL错误
495 0
|
安全 网络安全 数据安全/隐私保护
|
Python
python2 pip2 pip install web.py No module named wsgiserver
python2 pip2 pip install web.py No module named wsgiserver
113 0
|
Python
pip批量安装Python库 requirement.txt 离线环境无互联网环境下pip安装Python库
pip批量安装Python库 requirement.txt 离线环境无互联网环境下pip安装Python库
778 3

推荐镜像

更多