1

在新外壳中:

brew install python输出:

Warning: python-2.7.5 already installed

brew link python输出:

Warning: Already linked: /usr/local/Cellar/python/2.7.5
To relink: brew unlink python && brew link python

echo $PATH输出:

/Users/captbaritone/.rvm/gems/ruby-2.0.0-p0/bin:/Users/captbaritone/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/captbaritone/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/captbaritone/.rvm/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/local/git/bin:/usr/local/MacGPG2/bin:/usr/texbin:/opt/local/bin

which python仍然输出:

/usr/local/bin/python

并且python --version仍然输出:

Python 2.7.1

这是一个线索:

ls -l /usr/local/bin/python输出:

ls: /usr/local/bin/python: No such file or directory

关于我可能做错了什么的任何想法,或者我还能尝试什么?

4

1 回答 1

4

您没有正确链接python。如果您brew install python在终端上输入,它可能会输出警告:python-2.7.5 already installed, it's just not linked

如果是这样,您需要通过键入来链接您的 python 安装brew link python。如果您因为一些较早的站点包而遇到任何冲突,只需键入 as brew link --overwrite python

现在它应该可以正常工作了。

于 2013-10-10T07:02:02.847 回答