我正在嘗試在我的OSX10.9.4機器上安裝pip。我以前在使用不同版本的python時遇到過一些問題,但是我想我已經通過删除相應的檔案來解決這些問題。在
這是我嘗試sudo easy_install pip時得到的結果:╭─[email protected] ~
╰─➤ sudo easy_install pip 1 ↵
Password:
TEST FAILED: /lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/lib/python2.7/site-packages/
and your PYTHONPATH environment variable currently contains:
''
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
http://peak.telecommunity.com/EasyInstall.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
然後我在我的~/.zprofile中添加了export PYTHONPATH="/lib/python2.7/site-packages/"(我使用的是zsh)。在
我source ~/.zprofile并從我的系統中删除了損壞的pip,然後再次嘗試sudo easy_install pip,我得到了完全相同的錯誤。在
有人能告訴我我做錯了什麼,該怎麼做來彌補它嗎?還有誰能推薦一些我可以閱讀的資源來更好地了解這些東西的工作方式嗎?在