Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip error while installing Python: "Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS"

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?

like image 679
gil Got Avatar asked Jun 09 '16 10:06

gil Got


4 Answers

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
like image 161
eandersson Avatar answered Nov 01 '22 18:11

eandersson


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)

like image 22
Laurens Avatar answered Nov 01 '22 18:11

Laurens


On Ubuntu 18.04 only this worked for me

sudo apt-get install libssl1.0
like image 11
Jozef Cechovsky Avatar answered Nov 01 '22 17:11

Jozef Cechovsky


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.

like image 4
user4212639 Avatar answered Nov 01 '22 19:11

user4212639