-bash:pip:命令未找到

时间:2014-04-27 04:54:49

标签: macos pip

我以这种方式安装了点子:

$ sudo easy_install pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Best match: pip 1.5.4
Downloading https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb
Processing pip-1.5.4.tar.gz
Running pip-1.5.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-rl8K1T/pip-1.5.4/egg-dist-tmp-ikFNCe
warning: no files found matching 'pip/cacert.pem'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.rst' found under directory 'docs/_build'
no previously-included directories found matching 'docs/_build/_sources'
Adding pip 1.5.4 to easy-install.pth file
Installing pip script to /System/Library/Frameworks/Python.framework/Versions/2.7/bin
Installing pip2.7 script to /System/Library/Frameworks/Python.framework/Versions/2.7/bin
Installing pip2 script to /System/Library/Frameworks/Python.framework/Versions/2.7/bin

Installed /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

当我尝试使用pip时,得到以下错误信息:

$ pip
-bash: pip: command not found

我现在该怎么办?请帮助,谢谢。

2 个答案:

答案 0 :(得分:2)

您可以从上面的输出中看到pip命令已安装到/System/Library/Frameworks/Python.framework/Versions/2.7/bin。您没有说明正在运行的OS X版本,但在使用Apple提供的系统Python时,这不是脚本的默认位置;通常,pip等脚本会安装在/usr/local/bin中,通常包含在$PATH中。您应该弄清楚为什么要将脚本安装到框架bin目录中。也许你有一个非标准配置的~/.pydistutils.cfg文件?

答案 1 :(得分:0)

pip文件位于/System/Library/Frameworks/Python.framework/Versions/2.7/bin 因为它不在你的道路上所以它无法找到。只需创建一个解决问题的链接:
$ sudo ln /System/Library/Frameworks/Python.framework/Versions/2.7/bin / opt / local / bin / pip
而已。我遇到了同样的问题并以这种方式解决了。