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

虽千万人,吾往矣!
相关文章
How to Publish Your Code as a Pip Module
Last week, I have made a python cli tool. To make it more convenient to use, I want to publish it as a pip module, so I have made some research and mistakes, and finally succeeded.
48 9
Python使用urllib或者urllib2模块打开网页遇到ssl报错
Python使用urllib或者urllib2模块打开网页遇到ssl报错
74 0
【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
【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
2811 3
【Python】已完美解决:(executemany()方法字符串参数问题)more placeholders in sql than params available
【Python】已完美解决:(executemany()方法字符串参数问题)more placeholders in sql than params available
142 1
Python下载大文件时遇到了SSL握手失败,要怎么办?
在 Python 数据集下载中常遇程序中断问题, 如网络不稳定、API请求数量限制等。网络不稳定时可通过实现重试机制与使用短效代理IP应对。示例代码利用 `requests` 库实现自动重试功能,提高下载成功率。对于 API 请求数量限制,可通过控制请求速率和轮换代理IP解决。示例展示了如何控制请求间隔及使用代理池轮换来避免触发限制。这些技巧有助于确保下载任务的顺利进行。
Conda/Python更新失败:SSL错误
Conda/Python更新失败:SSL错误
300 0
使用Python自动检测SSL证书是否过期
使用Python自动检测SSL证书是否过期
303 0
python2 pip2 pip install web.py No module named wsgiserver
python2 pip2 pip install web.py No module named wsgiserver
77 0

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等