gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 18:36:40 26 4
gpt4 key购买 nike

我最近过渡到 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'

我做错了什么?

最佳答案

我不知道为什么,但这一次成功了:

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

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

关于python - 在 Anaconda 环境中使用 pip 安装模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21465151/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com