Install PIP for python on CentOS

I didn’t have python-pip in my repository so needed to download it from the website

wget https://bootstrap.pypa.io/get-pip.py

Now run python to install

python get-pip.py
Collecting pip
/tmp/tmpqL3LkR/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
/tmp/tmpqL3LkR/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 1.0MB/s
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 4.5MB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.29.0
/tmp/tmpqL3LkR/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
which pip
/usr/bin/pip

Looks like we got some messages from install. Lets resolve those. Uninstall pip

python -m pip uninstall pip
Uninstalling pip-9.0.1:
  /usr/bin/pip
  /usr/bin/pip2
  /usr/bin/pip2.7
  /usr/lib/python2.7/site-packages/pip-9.0.1.dist-info/DESCRIPTION.rst
  ....
Proceed (y/n)? y
  Successfully uninstalled pip-9.0.1

Install python urllib3

yum install python-urllib3

Now try pip install again

python get-pip.py
Collecting pip
  Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-9.0.1

Now the installation is clean.

Be the first to comment

Leave a Reply