pip安装成功,但下载依赖时报错the ssl module in Python is not available

当尝试使用pip安装依赖时,遇到警告提示ssl模块不可用。问题原因是Python版本与openssl版本不匹配。解决步骤包括确认版本、安装依赖、下载并编译高版本openssl、重新安装Python。按照指定教程进行操作后,问题得以解决。
摘要由CSDN通过智能技术生成

问题:

执行命令,能够正确得展示pip当前版本,证明pip安装没有问题,但是使用pip下载依赖时就会报错:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

pip3 -V

问题原因:

很好理解,就是the ssl module 这个ssl模块版本太低了

python版本需要和openssl的版本需要相对匹配
在Python3.7之后的版本,依赖的openssl,必须要是1.1或者1.0.2之后的版本

解决办法:

一、先确认版本
openssl version
二、安装依赖

如果已有,这步可以忽略

yum install gcc libffi-devel zlib* openssl-devel
当你看到警告信息 "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available" ,这意味着你的Python环境缺少SSL模块,导致pip无法正常使用TLS/SSL。这可能是由于你的Python版本不满足要求或者缺少相关依赖库所导致的。 解决这个问题有几种方案: 1. 升级Python版本: 如果你的Python版本过旧,可以尝试升级到较新的版本,因为较新的Python版本通常会自带SSL模块。 2. 安装依赖库: 检查你的系统是否缺少必要的依赖库,例如OpenSSL。你可以尝试安装相应的依赖库,然后重新编译和安装Python。 3. 使用虚拟环境: 如果你不想改变全局Python环境,你可以考虑使用虚拟环境来管理你的项目。虚拟环境可以独立于全局Python环境进行配置,从而避免了全局环境的影响。 综上所述,你可以尝试升级Python版本、安装相关依赖库或者使用虚拟环境来解决 "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available" 这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [解决 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not](https://blog.csdn.net/qq_49580107/article/details/126380616)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *3* [pip is configured with locations that require TLS/SSL](https://blog.csdn.net/TomorrowAndTuture/article/details/119989736)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值