Anaconda:安装Python模块

时间:2016-02-13 01:18:17

标签: python anaconda

我刚刚在Mac OSX Yosemite上安装了Anaconda,我已经启动并运行,包括Python,虽然我认为当我尝试" pip install"时,我的路径出了问题。新模块。

两者"哪个蟒蛇"和#34; pip"命令指向我的Anaconda文件夹。而且,做一个" pip install webbpsf"似乎经历了但模块没有出现在" conda列表中#34;我运行脚本时也没有导入它(ImportError:没有名为webbpsf的模块)。

我尝试使用" python setup.py install"手动安装webbpsf模块(从下载的模块目录)但是我收到的错误是我认为是指向问题的根源,即/ username / py-lib / path。见下文:

Checking .pth file support in /username/py-lib/
/username/anaconda/bin/python -E -c pass
TEST FAILED: /username/py-lib/ 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:

/username/py-lib/

and your PYTHONPATH environment variable currently contains:

'/username/anaconda/lib/python2.7/site-packages'

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:

  https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations

我挖得很深,试图找到这个/ py-lib / path设置的位置和方式,我查看推荐的链接无济于事。我在这里缺少什么?

2 个答案:

答案 0 :(得分:0)

尝试使用anaconda文件夹中的python bin文件来安装setup.py文件。

答案 1 :(得分:0)

我的问题是目录/ username / py-lib /(以及/ username / py-bin /)在〜/ .pydistutils.cfg中强制设置。我删除了该文件,“pip install whatever_module”执行了它应该做的事情。