如何使用python2.7 pip而不是默认pip [英] how to use python2.7 pip instead of default pip

查看:774
本文介绍了如何使用python2.7 pip而不是默认pip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我得到的版本:

  pip -V 

p>

  pip 1.3.1从/usr/lib/python2.6/site-packages(python 2.6)

如何使用pip的2.7版本:

  /usr/local/lib/python2.7/site-packages 


解决方案

在您的$ PATH变量中的某个位置应该有一个名为pip2.7的二进制文件。



通过键入



找到该输出

其中pip2.7

这应该打印像'/usr/local/bin/pip2.7'到你的stdout。如果它不打印这样的东西,它没有安装。在这种情况下,请通过运行

  $ wget https://bootstrap.pypa.io/get-pip.py 
$ sudo python2.7 get-pip.py

现在,和

 其中pip2.7 

应返回正确的输出。


I just installed python 2.7 and also pip to the 2.7 site package.

When I get the version with:

pip -V

It shows:

pip 1.3.1 from /usr/lib/python2.6/site-packages (python 2.6)

How do I use the 2.7 version of pip located at:

/usr/local/lib/python2.7/site-packages

解决方案

There should be a binary called "pip2.7" installed at some location included within your $PATH variable.

You can find that out by typing

which pip2.7

This should print something like '/usr/local/bin/pip2.7' to your stdout. If it does not print anything like this, it is not installed. In that case, install it by running

$ wget https://bootstrap.pypa.io/get-pip.py
$ sudo python2.7 get-pip.py

Now, you should be all set, and

which pip2.7

should return the correct output.

这篇关于如何使用python2.7 pip而不是默认pip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆