What is the official “preferred” way to install pi

2019-01-04 06:11发布

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

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

Or this, which I got from 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 ...

Or something entirely different?

16条回答
闹够了就滚
2楼-- · 2019-01-04 06:35

Do this:

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
pip install virtualenv

See

查看更多
爷的心禁止访问
3楼-- · 2019-01-04 06:35

On Debian the best way to do it would be

sudo apt-get install python-pip

查看更多
祖国的老花朵
4楼-- · 2019-01-04 06:37

On Ubuntu 12.04 I've had good luck just using the package manager:

sudo apt-get install python-pip virtualenvwrapper
查看更多
看我几分像从前
5楼-- · 2019-01-04 06:40

This answer comes from @webology on Twitter:

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

My added notes:

  • On Mac/Windows (and Linux if the apt repo is outdated) you'd replace the first step with downloading setuptools from http://pypi.python.org/pypi/setuptools
  • On Windows you'd have to omit virtualenvwrapper from the last step and install it manually somehow. I don't know if there's a way to do this without Cygwin, but I hope so.
查看更多
对你真心纯属浪费
6楼-- · 2019-01-04 06:40

Since virtualenvs contain pip by default, I almost never install pip globally. What I do ends up looking more like:

$ sudo apt-get install python-setuptools
$ curl -O http://python-distribute.org/distribute_setup.py
$ sudo python distribute_setup.py
$ sudo easy_install virtualenv

I then proceed to install and set up virtualenvwrapper to my liking and off I go. it might also be worthwhile to take a look at Jeremy Avnet's virtualenv-burrito:

https://github.com/brainsik/virtualenv-burrito

查看更多
戒情不戒烟
7楼-- · 2019-01-04 06:41
登录 后发表回答