当前位置: 首页 > 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错误了,这才终极解决之道。

http://www.dtcms.com/a/105456.html

相关文章:

  • 城电科技 | 光伏地砖:零碳城市的 太阳能发电“隐形发电站”
  • 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
  • TestNG简介
  • 吴恩达深度学习复盘(4)神经网络的前向传播
  • Linux中的权限管理
  • git clone 提示需要登录 github
  • #Linux内存管理# 在32bit Linux中,内核空间的线性映射的虚拟地址和物理地址是如何换算的?
  • PWA 进阶教程(三): 如何在 PWA 中实现后台同步
  • mediacodec服务启动时加载media_codecs.xml
  • MySql面试总结(五)
  • 关于修改 vue Element admin、若依, 等后台管理系统模板的一些全局样式问题:
  • 这样看数组