I downloaded the Python 3.5 source code and ran the following:
$ tar -xf Python-3.5.2.tar.xz
$ ./configure --with-ensurepip=upgrade
$ make
$ sudo make altinstall
It proceeded well until make
. When sudo make altinstall
ran, it printed:
Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS
What went wrong?
You are most likely not compiling Python with SSL/TLS support - this is likely because you don't have the SSL development dependencies installed on your system.
Install the following dependency, and then re-configure and re-compile Python 3.5.
Ubuntu
apt-get install libssl-dev
In addition it is recommended to install the following.
apt-get install make build-essential libssl-dev zlib1g-dev libbz2-dev libsqlite3-dev
CentOS
yum install openssl-devel
In addition it is recommended to install the following.
yum install zlib-devel bzip2-devel sqlite sqlite-devel openssl-devel
Please note that besides that as of version OpenSSL 1.1.0 (included from Ubuntu 18.04 repositories, I am not sure for other Linux distributions) there are python vesions that may have compilation issues (see this question and my answer), in short:
Python <3.4.5 and Python <3.5.3 have not implemented this newest version of OpenSSL, most likely other major Python versions suffer the same issue. The fix is to download the minor version that implements the fix (or newer). Check the full changelogs to check which minor version that is (changelog for 3.4 and 3.5)
On Ubuntu 18.04 only this worked for me
sudo apt-get install libssl1.0
CentOS:
If you didn't have openssl-devel
at the time of installing python, pip 8.1.1 won't install.
After installing openssl-devel
, reinstall python
.
This time it should install pip
just file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With