still advancing in my tutorial to learn python, I was told to do
sudo -H pip install requests
I get the following :
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting requests
Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
would someone know what I need to do to fix that once for all ?
thanks so much in advance
This is likely due to libssl being installed, then your python virtualenv env created, then something happening to libssl, such as being upgraded/removed. The first step to resolve is to ensure you have libssl installed. If you're not using pyenv, then however you installed Python remove it and reinstall.
Source code: Lib/ssl.py. This module provides access to Transport Layer Security (often known as “Secure Sockets Layer”) encryption and peer authentication facilities for network sockets, both client-side and server-side. This module uses the OpenSSL library.
Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!
Running ./configure
with --enable-optimizations
did the trick.
Here are the steps that worked for me on a Ubuntu 16.04 LTS box-
The lines related to ssl
in the Modules/Setup*
files are commented
cd to the directory where you have the Python tar extracted
cd /../../../Python-3.7.4/
Run configure with optimizations enabled
./configure --enable-optimizations
Run make and then make install
make
make install
I encountered this problem running pip on Powershell on Windows, using the Anaconda distribution. I was running it inside VSCode, but I don't think it makes much difference.
A quick turnaround for me was installing what I needed using the Anaconda prompt, which works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With