Last Updated: September 01, 2020
·
662
· dfang

pip missing ssl module

when python installed by pyenv, you may got this error:

pip install boto3
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting boto3
  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/boto3/
  Retrying (Retry(total=3, 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/boto3/
  Retrying (Retry(total=2, 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/boto3/

No need to reinstall opensll with homebrew,

JUST

PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA=openssl@1.1 pyenv install 3.7.1

link:
https://github.com/pyenv/pyenv/issues/950