1

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
user1543915
  • 1,025
  • 1
  • 10
  • 16
  • `pip install --upgrade pip` will upgrade pip – ggdx Jul 29 '18 at 13:03
  • 1
    Possible duplicate of [How do I update pip itself from inside my virtual environment?](https://stackoverflow.com/questions/15221473/how-do-i-update-pip-itself-from-inside-my-virtual-environment) – ggdx Jul 29 '18 at 13:03
  • @ggdx in the (venv) ? – user1543915 Jul 29 '18 at 13:04
  • https://pip.pypa.io/en/stable/installing/ – Klaus D. Jul 29 '18 at 13:05
  • @user1543915 - Yes. If you're in the venv, you should only do things in the venv so you don't screw up your host environment (i.e. the whole point of using a virtual env in the first place). – ggdx Jul 29 '18 at 13:21

2 Answers2

1

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

asad_hussain
  • 1,959
  • 1
  • 17
  • 27
0

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

safira
  • 105
  • 3