在 venv 中使用 pip (WIndows 10)

Using pip in venv (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

到路径。在此处找到解决方案:

但是因为我没有使用 anaconda 而是在虚拟环境中,所以我不能那样做,对吗? 那么我必须编辑 activate.bat 吗?如果是,具体是什么方式。 我可以添加

安装 OpenSSL 对我有用。看来 dll 的版本有问题。可以在此处找到更多信息,但对我来说已经足够了。