-1

I am trying to install a requirements.txt file that has the following format:

build-utils==0.1.1
cffi==1.11.5
fake-rpi==0.6.0
keyboard==0.13.2
numpy==1.14.3
PyAudio==0.2.11
pycparser==2.18
RPi.GPIO==0.6.3
samplerate==0.1.0
websockets==5.0.1

I use pip3 install -r ./PythonClient/requirements.txt to install the different packages. However, I keep having issues with SSL.

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting build-utils==0.1.1 (from -r ./PythonClient/requirements.txt (line 1))
  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/build-utils/
  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/build-utils/
  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/build-utils/
  Retrying (Retry(total=1, 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/build-utils/
  Retrying (Retry(total=0, 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/build-utils/
  Could not fetch URL https://pypi.org/simple/build-utils/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/build-utils/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
  Could not find a version that satisfies the requirement build-utils==0.1.1 (from -r ./PythonClient/requirements.txt (line 1)) (from versions: )
No matching distribution found for build-utils==0.1.1 (from -r ./PythonClient/requirements.txt (line 1))
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

What is causing this and how do I fix it?

EDIT: Let me clarify. I am trying to do this for Mac OS.

peachykeen
  • 4,143
  • 4
  • 30
  • 49
  • It seems your python wasn't built with an ssl lib. Maybe this post might help: https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3 Also, in which OS are you working on? – luz.arthur Jun 20 '18 at 20:50
  • Yes you are correct. – peachykeen Jun 20 '18 at 20:56
  • Possible duplicate of [pip cannot confirm SSL certificate: SSL module is not available](https://stackoverflow.com/questions/44290926/pip-cannot-confirm-ssl-certificate-ssl-module-is-not-available) – phd Jun 20 '18 at 21:31
  • @phd apologies for not clarifying before. I am looking for a solution specific to Mac OS, thus that other post does not answer my question. – peachykeen Jun 21 '18 at 00:08

1 Answers1

1

From this post I derived the answer: "SSL module in Python is not available" when installing package with pip3

If you are on OSX and have compiled python from source:

Install openssl using brew install openssl

Make sure to follow the instructions brew gives you about setting your CPPFLAGS >and LDFLAGS. In my case I am using the openssl@1.1 brew formula and I need these 3 >settings for the python build process to correctly link to my SSL library:

export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

Assuming the library is installed at that location.

Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54
peachykeen
  • 4,143
  • 4
  • 30
  • 49