繁体   English   中英

Anaconda:安装Python模块

[英]Anaconda: installing Python modules

我刚刚在Mac OSX Yosemite上安装了Anaconda,并且已经启动并运行了它,包括Python,尽管当我尝试“点安装”新模块时,我的路径有问题。

“哪个python”和“哪个pip”命令都指向我的Anaconda文件夹。 此外,执行“ pip install webbpsf”似乎可以完成,但是该模块没有出现在“ conda列表”中,也没有在运行脚本时导入(ImportError:没有名为webbpsf的模块)。

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

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 /路径的设置位置/方式,并查看了推荐的链接,但无济于事。 我在这里想念什么?

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM