ISquared
ISquared

Reputation: 472

SSL Certificate/Module error - pip 19.2.3 - Anaconda Prompt

First off, let me say I'm a beginner programmer and so far I managed to 'get away' without understanding too much about virtual environments, command prompts, Python shells, so please apologise if I don't understand the terminology that well (yet, I am reading about it second day now).

I am using Windows 10 and Anaconda, Python 3.7.7, Spyder 4.2.1., iPython shell 7.13.

So far I installed packages using the console (iPython) and pip install, successfully, no problems there at all. However, now I have to create a virtual environment as part of a WebDevelopment course I am doing.

I managed to create a new environment (as part of an existing directory, the server) using the Anaconda prompt, and activate it. That seemed to work. Then I had to install Flask. (Before, the unaware Me, installed it using pip in the console, and it worked, but obviously this is not in the environment I want for my project). And just trying pip install flask (as well as pip3 install flask), from within the activated virtual environment (webServer), gave me the error:

(webServer) C:\Users\path\to\directory\Python\project>pip install Flask WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting Flask
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/flask/ 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/flask/ 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/flask/ 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/flask/ 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/flask/ Could not fetch URL https://pypi.org/simple/flask/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/flask/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping ERROR: Could not find a version that satisfies the requirement Flask (from versions: none) ERROR: No matching distribution found for Flask WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping

I have been reading about this error and I tried various things suggested, such as:

pip install --upgrade --user pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org

as well as

curl https://bootstrap.pypa.io/get-pip.py >> get-pip.py
python get-pip.py

Neither of these change anything. This is the first time I encounter this, because so far all my installations have been from the console, using the pip that is in the main Anaconda directory.

pip definitely exists in the site packages of the newly installed virtual environment though.

And here my basic knowledge is insufficient to get if it is something due to Anaconda, due to the new environment I set up, etc.

Any help will be appreciated.

Upvotes: 0

Views: 1780

Answers (1)

ISquared
ISquared

Reputation: 472

PS For anyone who encounters this: After a lot of digging and trial and error, I solved the problem by adding :

C:\Users\User\Anaconda3\Library\bin

to my PATH list of Environmental variables.

Upvotes: 1

Related Questions