【发布时间】:2021-10-02 14:52:29
【问题描述】:
我看到过类似的问题,但我没有找到明确的解决方案:
我建立了一个 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吗?如果是的话,究竟是什么方式。 可以加吗
【问题讨论】:
-
这个问题是不是只出现在虚拟环境中?听起来 SSL 库无论如何都应该安装在全局级别。
-
哪个python版本?
-
好吧,当不添加 \Library\bin 路径时,这似乎是一个已知问题,我想我正在使用 python 3.8.5
标签: python ssl pip python-venv