2
votes

I'm using Debian 9 and I have installed Python 3.6.2 and pip 9.0.1. Still, there is a problem when I want to install modules like numpy, scipy or matplotlib. I always get the following error when I use the pip install command:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting numpy Could not fetch URL https://pypi.python.org/simple/numpy/: 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 numpy (from versions: ) No matching distribution found for numpy

I tried the top answer of this subject (pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)") but it didn't work. In fact, I get the same error message.

Unfortunately, this command was a fail as well.

pip install --index-url=http://pypi.python.org/simple/numpy --trusted-host pypi.python.org numpy

I hope someone will be able to solve my problem. Thanks in advance for your help. :D

2

2 Answers

6
votes
  1. Uncomment lines 209-212 in Python-3.6.2/Modules/Setup

    SSL=/usr/local/ssl _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto

  2. Make sure libssl-dev is installed

  3. Go to your Python directory and do ./configure, make, and make install

  4. Install packages with the following command: pip install --trusted-host pypi.python.org packageName

Hope that helped someone. :D

1
votes

I ran the following commands to resolve the issue

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