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

虽千万人,吾往矣!
目录
相关文章
|
2月前
|
Python
pip批量安装Python库 requirement.txt 离线环境无互联网环境下pip安装Python库
pip批量安装Python库 requirement.txt 离线环境无互联网环境下pip安装Python库
150 3
|
2月前
|
数据采集 网络安全 Python
Python使用urllib或者urllib2模块打开网页遇到ssl报错
Python使用urllib或者urllib2模块打开网页遇到ssl报错
32 0
|
4月前
|
网络安全 开发工具 Python
【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
【Azure事件中心】使用Python SDK(Confluent)相关方法获取offset或lag时提示SSL相关错误
|
5月前
|
开发者 Python
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
|
5月前
|
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
1360 3
|
5月前
|
自然语言处理 安全 Shell
【Python】已解决:Python pip正确安装pyhanlp库步骤
【Python】已解决:Python pip正确安装pyhanlp库步骤
213 2
|
5月前
|
开发者 Python
【Python】已解决:(Python3中pip无法安装urllib报错问题) ERROR: Could not find a version that satisfies the requireme
【Python】已解决:(Python3中pip无法安装urllib报错问题) ERROR: Could not find a version that satisfies the requireme
354 0
【Python】已解决:(Python3中pip无法安装urllib报错问题) ERROR: Could not find a version that satisfies the requireme
|
5月前
|
安全 Python
【Python】 已解决:(pip提示)[notice] To update, run: python.exe -m pip install --upgrade pip
【Python】 已解决:(pip提示)[notice] To update, run: python.exe -m pip install --upgrade pip
325 0
【Python】 已解决:(pip提示)[notice] To update, run: python.exe -m pip install --upgrade pip
|
5月前
|
网络安全 API Python
Python下载大文件时遇到了SSL握手失败,要怎么办?
在 Python 数据集下载中常遇程序中断问题, 如网络不稳定、API请求数量限制等。网络不稳定时可通过实现重试机制与使用短效代理IP应对。示例代码利用 `requests` 库实现自动重试功能,提高下载成功率。对于 API 请求数量限制,可通过控制请求速率和轮换代理IP解决。示例展示了如何控制请求间隔及使用代理池轮换来避免触发限制。这些技巧有助于确保下载任务的顺利进行。
|
5月前
|
IDE 开发工具 Python
【Python】已解决:pip安装第三方模块(库)与PyCharm中不同步的问题(PyCharm添加本地python解释器)
【Python】已解决:pip安装第三方模块(库)与PyCharm中不同步的问题(PyCharm添加本地python解释器)
985 0