当前位置: 首页 > news >正文

conda安装python 遇到 pip is configured with locations that require TLS/SSL问题本质解决方案

 以前写了一篇文章,不过不是专门为了解决这个问题的,但是不能访问pip install 不能安装来自https 协议的包问题几乎每次都出现,之前解决方案只是治标不治本

https://blog.csdn.net/wangsenling/article/details/130194456​​​​​​​https://blog.csdn.net/wangsenling/article/details/130194456根本原因在于,你用conda安装不同版本的python时,如果没指定配套的openssl版本,那么python就会默认使用你系统安装的openssl版本

因为你安装conda的时候,conda默认使用python12版本作为默认引擎,而python12使用的openssl版本较高,导致你创建一个python3.8版本时,就会报错

(venv) D:\pycharmProjects\whatsapp-desktop-api>pip3 install -r requirements.txt 
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/aiofiles/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/aiofiles/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/aiofiles/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/aiofiles/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/aiofiles/

解决方案

conda在创建python版本时,指定openssl对应版本,例如python3.8使用1.1.1,这样就创建了一个py38版本,且使用的是openssl=1.1.1版本的

conda create -n py38 python=3.8 openssl=1.1.1

 这时你在cmd下输入openssl 和 在pycharm激活环境下查看是不同的,证明相互之间不会互相干扰

CMD下

 Pycharm 下的python38环境下是 1.1.1版本,目前安装时,已经不再报ssl错误了,这才终极解决之道。

相关文章:

  • 城电科技 | 光伏地砖:零碳城市的 太阳能发电“隐形发电站”
  • Muduo网络库实现 [五] - Poller模块
  • 技术回顾day2
  • Linux 2021韩顺平网课笔记:进程管理
  • 树莓派超全系列文档--(19)树莓派配置网络
  • 音乐缓存管理器的性能优化方法分析
  • 相机的曝光和增益
  • CSS中的overflow属性
  • C#从入门到精通(5)
  • 激活函数学习笔记
  • es 3期 第28节-深入掌握集群组建与集群设置
  • 清理redis缓存
  • 架构师论文《论软件质量保证及其应用》
  • 令牌与签名的区别(IT安全/认证机制)
  • blender场景导入Unity的流程(个人总结)
  • net8.0 使用JWT完成登录验证
  • NVR接入录像回放平台EasyCVR视频系统守护舌尖上的安全,打造“明厨亮灶”云监管平台
  • Playwright与Browser Use:领略AI赋能UI自动化测试的魔法魅力
  • 从入门到精通【MySQL】 联合查询
  • Springboot学习笔记3.28
  • 《单身情歌》制作人韩贤光去世,林志炫发文悼念
  • 中美经贸高层会谈将在午餐后继续
  • 教育部答澎湃:2025世界数字教育大会将发布系列重磅成果
  • 售卖自制外挂交易额超百万元,一男子因提供入侵计算机系统程序被抓
  • 三大交易所多举措支持科创债再扩容,约160亿证券公司科创债有望近期落地
  • 特朗普要征电影关税惊扰全球电影业,“让好莱坞再次伟大”或现反效果