0

I installed pip this way:

$ 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

when I try to use pip, got below error information:

$ pip
-bash: pip: command not found

what should I do now? please help, thanks.

3
  • 1
    Seems like a $PATH issue. Try: /usr/bin/pip ? And fix your $PATH in your .bashrc perhaps?
    – Kevin
    Apr 27, 2014 at 4:58
  • $ /usr/bin/pip -bash: /usr/bin/pip: Too many levels of symbolic links Apr 27, 2014 at 15:04
  • Normally, there isn't a /usr/bin/pip on OS X.
    – Ned Deily
    Apr 27, 2014 at 19:21

2 Answers 2

2

You can see from the above output that the pip command has been installed to /System/Library/Frameworks/Python.framework/Versions/2.7/bin. You don't say which version of OS X you are running on but that is not the default location for scripts when using the Apple-supplied system Python; normally, scripts, like pip, would be installed in /usr/local/bin which is normally included in $PATH. You should figure out why scripts are being installed into the framework bin directory. Perhaps you have a ~/.pydistutils.cfg file with a non-standard configuration?

2
  • seems that I mess up my python environment already, how can I recover mac default python environment? My OS X is 10.8.3, thank you in advance Apr 27, 2014 at 15:05
  • 1
    It's hard to tell from the information you've given what state your system is in. The safest and most reliable way to return your system to a known state is to re-install OS X. Since you are running an out-of-date system now, you might consider just upgrading to OS X 10.9 Mavericks. In the future, avoid modifying, adding, or deleting files in /System/Library and /usr other than /usr/local. Good luck!
    – Ned Deily
    Apr 27, 2014 at 19:23
0

the file of pip is in /System/Library/Frameworks/Python.framework/Versions/2.7/bin coz it not on your path so it can't be found. just create a link to fix the problem:
$sudo ln /System/Library/Frameworks/Python.framework/Versions/2.7/bin /opt/local/bin/pip
that's it. I got the same problem and fixed it this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.