I've install Python 3.4 and Python 3.6 on my local machine successfully, but am unable to install packages with pip3
.
When I execute pip3 install <package>
, I get the following SSL related error:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting <package>
Could not fetch URL https://pypi.python.org/simple/<package>/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement <package> (from versions: )
No matching distribution found for <package>
How can I fix my Python3.x install so that I can install packages with pip install <package>
?
The problem probably caused by library missing.
Before you install python 3.6, make sure you install all the libraries required for python.
More information in How to Install Python 3.6.0 on Ubuntu & LinuxMint
I was having the same problem for the last two days and only have fixed it right now.
I had tried to use
--trust-host
option with theDigiCert_High_Assurance_EV_Root_CA.pem
did not work, I couldn't install the ssl module (It tells it cannot be installed for python versions greater than 2.6), setting the$PIP_CERT
variable didn't fix it either and I hadlibssl1.0.2
andlibssl1.0.0
installed. Also worth mentioning I didn't had a~/.pip/pip.conf
file, and creating it didn't solve the bug either.What finally solved it, was installing python3.6 with
make
again. Download the Python-3.6.0.tgz from the website, runconfigure
thenmake
,make test
andmake install
. Hope it works for you.Agree with the answer by mastaBlasta. Worked for me. I encountered the same problem as the topic description.
Environment: MacOS Sierra. And I use Homebrew.
My solution:
brew uninstall openssl, brew install openssl
;According to the hints given by Homebrew, do the following:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"