1

Note.
I know that many solutions have been proposed in this very relevant post but they are all very different and assume vastly different problems, and I don't want to blindly try one at random just to see what happens.

The problem.
I was working on a Jupiter notebook when I started getting errors (with the kernel, cannot quite remember exactly what, now). After trying a few things and searching the web, it seems the problem is that pip broke, somehow. Namely, I am getting the

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available..

error message. Some further reading suggests that the problem is with homebrew?

This puzzles me for two reasons:
- I don't see what I did that broke pip;
- pip for all of my virtual environments seem broken.

What is the problem, really, and where does it come from?

Setup.
- macOS Catalina 10.15.3.
- pyenv as Python virtual environment manager - outputs below for Python and pip versions

Some outputs.
The command pip --version with python3.8.2 is very strange. Going through the site-packages of the python3.8.2 install, it looks like pip version is 19.2.3.

The errors are not the quite the same for the different versions of pip.

$ pyenv local 3.6.7 && pip --version && pip list
pip 10.0.1 from /Users/antoine/.pyenv/versions/3.6.7/lib/python3.6/site-packages/pip (python 3.6)
# prints list correctly
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
$ pyenv local 3.7.1 && pip --version && pip list
pip 10.0.1 from /Users/antoine/.pyenv/versions/3.7.1/lib/python3.7/site-packages/pip (python 3.7)
# prints list correctly
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
$ pyenv local 3.7.4 && pip --version && pip list
pip 19.3.1 from /Users/antoine/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pip (python 3.7)
# prints list correctly
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
$ pyenv local 3.8.2 && pip --version # produces error, no need to try `pip list`
# prints something that looks like ImageMagick help documentation
By default, 'file' is written in the MIFF image format.  To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps).  Specify 'file' as '-' for
standard input or output.
import: delegate library support not built-in '' (X11) @ error/import.c/ImportImageCommand/1282.
from: can't read /var/mail/pip._internal
/Users/antoine/.pyenv/versions/3.8.2/bin/pip: line 9: syntax error near unexpected token `('
/Users/antoine/.pyenv/versions/3.8.2/bin/pip: line 9: `    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])'
Antoine
  • 455
  • 3
  • 17

0 Answers0