在Snowleopard上使用Homebrew升级的Python现在pip和easy_install不起作用

Joe*_*ake 4 python pip easy-install

我是python的新手,我已经改变了我的路径指向新的python 2.7,但是pip和easy_install,并且mercurial仍在查看默认安装的2.6版本.我该如何解决?

bra*_*ers 5

您需要安装pipsetuptools试(它提供了easy_install命令)为您的新Python版本.pip并且setuptools不是全局安装的,而是必须专门为系统上的每个Python版本安装它们.

要安装pip:

$ curl -O https://github.com/pypa/pip/raw/master/contrib/get-pip.py
$ python get-pip.py
Run Code Online (Sandbox Code Playgroud)

要安装setuptools:

$ curl -O http://peak.telecommunity.com/dist/ez_setup.py
$ python ez_setup.py
Run Code Online (Sandbox Code Playgroud)

...但你可能应该使用Distribute(它是更新的版本setuptools):

$ curl -O http://python-distribute.org/distribute_setup.py
$ python distribute_setup.py
Run Code Online (Sandbox Code Playgroud)