Install pip Python

Question:

Please, why i have pip 1.5.4 in the (venv) ? how can i upgrade pip to 8.1.2 in the venv ? Thanks

 root@graphene-95:~# pip -V
 pip 8.1.2 from /usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg
 (python 2.7)
 root@graphene-95:~# pip3 -V
  The program 'pip3' is currently not installed. You can install it by     
 typing:
 apt-get install python3-pip
 root@graphene-95:~# source ~/tensorflow/venv/bin/activate
 (venv)root@graphene-95:~# pip -V
 pip 1.5.4 from /root/tensorflow/venv/local/lib/python2.7/site-packages
 (python 2.7)
 (venv)root@graphene-95:~# pip3 -v
 The program 'pip3' is currently not installed. You can install it by   
 typing:

 apt-get install python3-pip
Asked By: user1543915

||

Answers:

In order to install a specific version of pip , use the command
pip install pip==8.2.1 after activating your virtual environment.

And , if you get SSL error like this

Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping.

Then , first you to have get the latest pip , then only you can install a particular version of pip.So, to get latest pip, execute this command

curl https://bootstrap.pypa.io/get-pip.py | python.

Now try this pip install pip==8.2.1

Answered By: asad_hussain

i solved with the following command, and it worked for me:
sudo su root
sudo su root apt-get purge -y python-pip
wget https://bootstrap.pypa.io/get-pip.py python ./get-pip.py
apt-get install python-pip

Answered By: safira
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.