在Mac OS X上安装pip - PYTHONPATH

时间:2014-09-22 16:07:43

标签: python unix environment-variables pip

我正在尝试在我的OS X 10.9.4计算机上安装pip。我以前在使用不同版本的python时遇到了问题,但我想我已经通过删除相应的文件解决了这些问题。

这是我尝试sudo easy_install pip时得到的:

╭─ishaantaylor@Ishaans-MacBook-Pro.local ~
╰─➤  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.

然后我将export PYTHONPATH="/lib/python2.7/site-packages/"添加到我的〜/ .zprofile(我使用zsh)。

source ~/.zprofile并从我的系统中删除了已损坏的点子并再次尝试sudo easy_install pip,我得到了完全相同的错误。

有人可以告诉我我做错了什么,以及如何解决这个问题?也有人可以推荐我能阅读的任何资源,以便更好地理解这些工作的方式吗?

0 个答案:

没有答案