0
votes

I'm getting this error when trying pip install NumPy:

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

Does anyone know how to solve this?

2
Please provides pip version with command: pip -V - Ave
try to install libssl-dev with apt-get ... - Gerard Rozsavolgyi
@vanloc pip 9.0.1 from /home/nguyennguyenquochuy/tutorial-env/lib/python3.6/site-packages (python 3.6) - Huy Nguyen
@GerardRozsavolgyi it's not working. - Huy Nguyen

2 Answers

0
votes

Solution 1: Maybe try with sudo -E:

 -E          The -E (preserve environment) option indicates to the secu‐
             rity policy that the user wishes to preserve their existing
             environment variables.  The security policy may return an
             error if the -E option is specified and the user does not
             have permission to preserve the environment.

Solution 2: proxy can be the affect to that. So:

sudo pip --proxy=http://username:password@proxyURL:portNumber install your-package
0
votes

You may have one issue or two:

First you need to install OpenSSL with the following command:

sudo apt-get install openssl

Second make sure your python versions compiled against SSL. I believe you installed a precompiled version. In that case it will be fine. Otherwise you will need to install libssl-dev too before building your python