1
$ sudo pip install numpy    # or anything else

error:
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. (tried sudo -H, the rest errors persist)
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
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/numpy/
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

$ python -V

Python 3.7.3

$ pip -V

pip 19.0.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

$ whereis pip

pip: /usr/local/bin/pip2.7 /usr/local/bin/pip3.7 /usr/local/bin/pip /usr/local/bin/pip3.6

pip3.6 appeared after:

$ sudo su
$ update-alternatives --install /usr/bin/python python /usr/bin/python3 1

In anaconda environments, pip works fine.

Is deleting things related with python, at a safe extend - without breaking the system, and re-install stuff properly, a preferable solution? And how to do so?

I know that there are a lot of similar questions, but I 've tried a lot of stuff (obviously, I messed something) and I haven't solve the problem.

Thanks!

2
  • try asking this on askubuntu.com Commented Aug 8, 2019 at 14:44
  • Thanks, I will ask there, too. Commented Aug 8, 2019 at 14:52

1 Answer 1

3

You might need to install openssl and libssl-dev.

# apt-get install libssl-dev libffi-dev openssl

Sign up to request clarification or add additional context in comments.

3 Comments

Have you compiled Python?
What do you mean? I can run python scripts prepending 'python'.
I downloaded a new python tar from python.org and compiled it, so this was the solution. Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.