[英]Trouble using pip after installing Python 2.7 with Homebrew on Mac OS X 10.6.8
I just used homebrew to install Python 2.7.2 on a clean Mac OS X Snow Leopard install, but seem to be having trouble getting PIP to work with it well. 我只是使用自制软件在干净的Mac OS X Snow Leopard安装上安装了Python 2.7.2,但似乎很难让PIP很好地与它一起工作。
Here are the steps that I took: 这是我采取的步骤:
brew install python --framework --universal
brew install python --framework --universal
: brew install python --framework --universal
.zsrc
.zsrc
路径 /System/Library/Frameworks/Python.framework/Versions/Current
to /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/Current
/System/Library/Frameworks/Python.framework/Versions/Current
到/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/Current
进行符号链接 easy_install
to install pip
easy_install
安装pip
These steps seem like they have worked: 这些步骤似乎奏效了:
$ brew doctor
Your system is raring to brew.
$ which python
/usr/local/bin/python
$ python --version
Python 2.7.2
$ which easy_install
/usr/local/share/python/easy_install
$ which pip
/usr/local/bin/pip
However, when I try to install things with pip, for example $ pip install ipython
I get this error message '/System/Library/Frameworks/Python.framework/Versions/2.6/share': Permission denied
但是,当我尝试使用pip安装东西时,例如
$ pip install ipython
我收到此错误消息'/System/Library/Frameworks/Python.framework/Versions/2.6/share': Permission denied
Why is pip still trying to install an old Python 2.6 location? 为什么pip仍然尝试安装旧的Python 2.6位置? How do I get it to install things to
/usr/local/Cellar/python/2.7.2/
etc? 如何将其安装到
/usr/local/Cellar/python/2.7.2/
等目录?
Homebrewed Python now installs pip
. 自制Python现在会安装
pip
。
Since a while pip is installed directly into your homebrew-bin directory. 由于一会儿 pip直接安装到您的homebrew-bin目录中。
Therefore, $(brew --prefix)/bin/pip
should be in your PATH
, if your Homebrewbrew is set up correctly. 因此,如果正确设置了Homebrewbrew,则
$(brew --prefix)/bin/pip
应该位于PATH
。
So, it looks like the way that I installed things I needed to use /usr/local/share/python/pip-2.7
instead of /usr/local/share/python/pip
. 因此,看起来就像我安装使用
/usr/local/share/python/pip-2.7
而不是/usr/local/share/python/pip
所需的东西的方式。
Not sure why I have both pip and pip-2.7 but Aliasing my pip to the the 2-7 version seems to fix my issue. 不知道为什么我同时拥有pip和pip-2.7,但是将我的pip别名为2-7版本似乎可以解决我的问题。
Why are you using easy_install
to install pip? 为什么要使用
easy_install
安装pip? Based on the path easy_install is probably pointing to Python 2.6, which results to pip point to 2.6 as well. 基于该路径,easy_install可能指向Python 2.6,结果pip也指向2.6。
Doesn't brew install pip
fix this? brew install pip
不能解决此问题吗?
Otherwise what you are doing looks correct 否则,您正在做的事情看起来正确
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.