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

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

问题描述

我刚刚安装了 python 2.7 并且还 pip 到了 2.7 站点包.

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

当我获得版本时:

pip -V

显示:

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

如何使用位于以下位置的 2.7 版 pip:

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

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

推荐答案

应该有一个名为pip2.7"的二进制文件;安装在 $PATH 变量中包含的某个位置.

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

你可以通过输入找到

which pip2.7

这应该会在您的标准输出中打印类似/usr/local/bin/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/pip/2.7/get-pip.py
$ sudo python2.7 get-pip.py

现在,你应该已经准备好了

Now, you should be all set, and

which pip2.7

应该返回正确的输出.

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

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