Search code examples
pythonsslpippython-venv

Using pip in venv (WIndows 10)


I have seen similar questions but I didn't see a definite solution for my problem:

I set up a python virtual environment and want to install python libraries. I am using VisualStudio Code on Windows 10 and get the following error when installing with pip:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

And after retrying 5 times:

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

It seems that the solution would be to add

D:\Anaconda3 
D:\Anaconda3\Scripts
D:\Anaconda3\Library\bin

to the PATH. Solution found here:

https://stackoverflow.com/questions/45954528/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-in

But since I am not using anaconda and am on a virtual environment I can't do that right? So do I have to edit the activate.bat? And if yes, in what way exactly. Can I add


Solution

  • Installing OpenSSL has worked for me. It seems there was a problem with the versions of the dlls. Further information can be found here but it's good enough for me.

    https://stackoverflow.com/a/67653437/15980312