windows/linux环境python3出现pip is configured with locations that require TLS/SSL, however the..不可用的解决方法

linux环境下

首先明确问题出现原因,是因为openssl版本过低或者不存在 so:

  1. 查看openssl安装包,发现缺少openssl-devel包 
    [root@localhost ~]# rpm -aq|grep openssl 
    openssl-0.9.8e-20.el5 
    openssl-0.9.8e-20.el5 
    [root@localhost ~]#

  2. yum安装openssl-devel 
    [root@localhost ~]# yum install openssl-devel -y 
    查看安装结果 
    [root@localhost ~]# rpm -aq|grep openssl 
    openssl-0.9.8e-26.el5_9.1 
    openssl-0.9.8e-26.el5_9.1 
    openssl-devel-0.9.8e-26.el5_9.1 
    openssl-devel-0.9.8e-26.el5_9.1

  3. 重新对python3.6进行编译安装,用一下过程来实现编译安装:

cd Python-3.6.4
./configure --with-ssl
make
sudo make install

 

Windows环境下:

解决方法为到https://slproweb.com/products/Win32OpenSSL.html上下载winopessl,直接下载第一个MSI安装即可:

之后问题就解决了

 

Linux下离线安装Python环境时,遇到"pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available."这个错误提示,通常是由于缺少SSL模块导致的。要解决这个问题,可以按照以下步骤进行操作: 1. 首先,确认你的系统中是否已经安装了openssl和libssl-dev等相关的软件包。如果没有安装,可以使用包管理器(如apt-get、yum等)来安装这些软件包。 2. 如果已经安装了这些软件包,但仍然遇到该错误,可能是因为Python没有正确链接到SSL库。此时,可以尝试重新编译和安装Python。 3. 在重新编译和安装Python之前,需要确保已经下载了Python源代码。你可以从Python官方网站上下载最新的稳定版本。 4. 解压源代码后,进入解压后的目录,并执行以下命令来配置编译选项: ``` ./configure --with-ssl ``` 5. 然后,执行以下命令来编译和安装Python: ``` make sudo make install ``` 6. 完成安装后,你可以使用新安装的Python版本来验证一下是否已经解决SSL模块不可用的问题。可以通过以下命令来检查pip是否能正常工作: ``` python -m pip --version ``` 通过按照上述步骤重新编译和安装Python,应该能够解决"pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available."这个错误,并使得pip能够正常工作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [pip is configured with locations that require TLS/SSL, however the ssl module in Python not](https://blog.csdn.net/MacWx/article/details/130365202)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Ubuntu/Deepin下Python3.8出现SSL错误的解决方案](https://download.csdn.net/download/weixin_38641561/14042425)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [ pip is configured with locations that require TLS/SSL, however the ssl module in Python](https://blog.csdn.net/yuan2019035055/article/details/127078251)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 74
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值