官方的“首选"是什么?系统范围内安装pip和virtualenv的方法? [英] What is the official "preferred" way to install pip and virtualenv systemwide?

查看:86
本文介绍了官方的“首选"是什么?系统范围内安装pip和virtualenv的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是人们似乎最常推荐的:

Is it this, which people seem to recommend most often:

$ 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
如果不是:
更新(从发行说明中):

If you can install the latest Python (2.7.9 and up) Pip is now bundled with it. See: https://docs.python.org/2.7//installing/index.html
If not :
Update (from the release notes):

从v1.5.1开始,pip在运行get-pip.py之前不需要setuptools.此外,如果尚未安装setuptools(或分发),则get-pip.py将为您安装setuptools.

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

Here are the official installation instructions: http://pip.readthedocs.org/en/latest/installing.html#install-pip

EDIT 2013年7月25日:
更改了用于setuptools安装的URL.

EDIT 25-Jul-2013:
Changed URL for setuptools install.

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

EDIT 10-Feb-2014:
Removed setuptools install (thanks @Ciantic)

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

EDIT 26-Jun-2014:
Updated URL again (thanks @LarsH)

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

EDIT 1-Mar-2015:
Pip is now bundled with Python

这篇关于官方的“首选"是什么?系统范围内安装pip和virtualenv的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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