在Anaconda环境中使用pip安装模块

时间:2014-01-30 18:55:38

标签: python python-2.7 pip anaconda

我最近在RHEL6上转换到Anaconda环境,但我需要一个不在conda存储库中的模块。所以我用pip安装它:

(gt_keys)[user@server gtkey]$ which pip
/srv/home/shared/anaconda/envs/gt_keys/bin/pip

(gt_keys)[user@server gtkey]$ pip install owslib
Downloading/unpacking owslib
Downloading OWSLib-0.8.3.tar.gz (97kB): 97kB downloaded
Running setup.py egg_info for package owslib

Requirement already satisfied (use --upgrade to upgrade): python-dateutil>=1.5 in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): pytz in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): pytest in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): pytest-cov in /srv/home/shared/anaconda/lib/python2.7/site-packages (from owslib)
Requirement already satisfied (use --upgrade to upgrade): PIL in /srv/home/shared/anaconda/lib/python2.7/site-packages/PIL (from owslib)
Requirement already satisfied (use --upgrade to upgrade): cov-core>=1.6 in /srv/home/shared/anaconda/lib/python2.7/site-packages (from pytest-cov->owslib)
Requirement already satisfied (use --upgrade to upgrade): coverage>=3.4 in /srv/home/shared/anaconda/lib/python2.7/site-packages (from cov-core>=1.6->pytest-cov->owslib)
Installing collected packages: owslib
  Running setup.py install for owslib

Successfully installed owslib
Cleaning up...

但它在我的环境中不起作用:

(gt_keys)[user@server gtkey]$ which python
/srv/home/shared/anaconda/envs/gt_keys/bin/python

(gt_keys)[user@server gtkey]$ python -c 'import owslib'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named owslib

owslib只进入Ananaconda安装基地:

sh-4.1$ which python
/srv/home/shared/anaconda/bin/python
sh-4.1$ python -c 'import owslib'

我做错了什么?

1 个答案:

答案 0 :(得分:1)

我不知道为什么,但这次它起作用了:

pip install owslib --allow-external PIL --allow-unverified PIL

我仍然会对我的流程有任何评论感兴趣。昨晚失败后我今天早上重新连接到服务器时发生了一些奇怪的事情。必须是路径的东西。