python - 在 venv 中使用 pip (Windows 10)
问题描述
我见过类似的问题,但我没有看到我的问题的明确解决方案:
我设置了一个 python 虚拟环境并想安装 python 库。我在 Windows 10 上使用 VisualStudio Code,使用 pip 安装时出现以下错误:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
重试5次后:
Could not fetch URL https://pypi.org/simple/opencv/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries
exceeded with url: /simple/opencv/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
似乎解决方案是添加
D:\Anaconda3
D:\Anaconda3\Scripts
D:\Anaconda3\Library\bin
到路径。在这里找到的解决方案:
https://stackoverflow.com/questions/45954528/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-in
但是由于我没有使用 anaconda 并且在虚拟环境中,所以我不能这样做吗?那么我必须编辑activate.bat吗?如果是的话,究竟是什么方式。我可以添加吗
解决方案
安装 OpenSSL 对我有用。似乎dll的版本有问题。可以在此处找到更多信息,但这对我来说已经足够了。
推荐阅读
- excel-formula - 如果为空白,则使用单元格的值,如果不是空白,则在 excel 中运行此公式
- python - 按日期将文件合并为一个文件
- server-side-rendering - 使用 SSR 时,Spartacus 未从本地 JSON 文件加载翻译
- iis - 如何检查 IIS 上每个会话的内存使用情况?
- acumatica - 参考自定义父级扩展基本 DAC
- vue.js - 在 vueJS 中导航时事件单击不起作用
- regex - GCP Cloud Sql使用正则表达式提取查询持续时间
- javascript - Styled-Components - 将道具/主题传递给关键帧?
- bash - 如何使用 Unix 脚本从 csv 文件的一列中操作数据?
- mysql - TO_DATE 查询的 MS SQL 版本