python - 在系统范围内安装 pip 和 virtualenv 的官方 "preferred"

这是人们最常推荐的吗:

$ sudo apt-get install python-setuptools
$ sudo easy_install pip
$ sudo pip install virtualenv

或者这个,我从 http://www.pip-installer.org/en/latest/installing.html 得到的:

$ curl -O https://github.com/pypa/virtualenv/raw/master/virtualenv.py
$ python virtualenv.py my_new_env
$ . my_new_env/bin/activate
(my_new_env)$ pip install ...

还是完全不同的东西?

最佳答案

如果您可以安装最新的 Python(2.7.9 及更高版本),Pip 现在已与它捆绑在一起。 见:https://docs.python.org/2.7//installing/index.html
如果不是:
更新(来自发行说明):

Beginning with v1.5.1, pip does not require setuptools prior to running get-pip.py. Additionally, if setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.

我现在运行常规:

curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python

以下是官方安装说明: http://pip.readthedocs.org/en/latest/installing.html#install-pip

2013 年 7 月 25 日编辑:
更改了 setuptools 安装的 URL。

2014 年 2 月 10 日编辑:
删除了 setuptools 安装(感谢@Ciantic)

2014 年 6 月 26 日编辑:
再次更新网址(感谢@LarsH)

2015 年 3 月 1 日编辑:
Pip 现在与 Python 捆绑在一起

关于python - 在系统范围内安装 pip 和 virtualenv 的官方 "preferred"方式是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5585875/

相关文章:

python - matplotlib 中的曲面图

python - 使用 pandas GroupBy.agg() 对同一列进行多个聚合

python - Python字典中的线程安全

python - 如何从具有透明背景的 matplotlib 导出绘图?

python - Python中numpy.random和random.random的区别

python - Python 多处理模块的 .join() 方法到底在做什么?

python - 如何在 Tesseract 和 OpenCV 之间进行选择?

python - 如何使用 Pandas 创建随机整数的 DataFrame?

python - NumPy:同时 max() 和 min() 的函数

python - 断言 numpy.array 相等性的最佳方法?