简体   繁体   English

安装 pip Python

[英]Install pip Python

Please, why i have pip 1.5.4 in the (venv)?请问,为什么我在(venv)中有pip 1.5.4? how can i upgrade pip to 8.1.2 in the venv?如何在 venv 中将 pip 升级到 8.1.2? 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

In order to install a specific version of pip, use the command pip install pip==8.2.1 after activating your virtual environment.要安装特定版本的 pip,请在激活虚拟环境后使用命令pip install pip==8.2.1

And, if you get SSL error like this而且,如果你得到这样的 SSL 错误

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 . 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那么,首先你要获得最新的pip,然后你只能安装特定版本的pip。所以,要获得最新的pip,执行这个命令

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

Now try this pip install pip==8.2.1现在试试这个pip install pip==8.2.1

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我用以下命令解决了,它对我有用: 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM