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

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

On Ubuntu 18.04 only this worked for me

sudo apt-get install libssl1.0

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)