Pip cannot verify SSL certificate: SSL module not available
I'm trying to install RPi.GPIO for Python 3.6 on my Raspberry Pi Zero W, but somehow it won't connect to python.org. I have the protocol set for 2.7, 3.0 and 3.6, so when I go and do something like:
sudo pip3.6 install RPi.GPIO
I am getting this error:
pi @raspberrypi: ~ $ sudo pip3.6 install RPi GPIO
pip is configured with addresses requiring TLS / SSL, however the ssl module is not available in Python.
Collecting RPi.GPIO
Failed to get URL https://pypi.python.org/simple/rpi-gpio/ : There was a problem with validating the ssl certificate: Ca n't connect to HTTPS URL because SSL module is not available. - skip
Failed to find version that meets RPi.GPIO requirement (from versions :)
No matching distribution found for RPi.GPIO
I tried sudo apt-get install openssl
and so on, but it still doesn't work. I can access the website perfectly on my desktop and on my phone, but my Raspberry Pi won't be there at all. Any idea what I can do?
source to share
Before installing python 3.6, you need to install the required libraries.
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Do you have these installed on PI?
More details here
source to share
I am facing the same problem, finally I solved it by following
-
Check if openssl-devel is installed. My OS is centos6 and the install command is as follows:
yum install openssl-devel -y
-
Modify python source config file
vi / {yourpythonsource} / Modules / Customization
... Uncomment some of the content like this
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
recompile python.
cd /{yourpythonsource}
make && make install
Pip3 should be fine now.
source to share