问题描述
我使用的是 Ubuntu 16.04,并且一直在疯狂地尝试安装 GDCM,以便我可以将它与 Python 一起使用.我安装了 pipenv
,我怀疑这会导致问题.
我做了sudo apt-get install libgdcm2.6 python-gdcm
.它似乎安装得很好,但是当我运行 python
然后 import gdcm
时,它抱怨没有名为 gdcm
的模块.
有人遇到过吗?
这意味着 python 在其环境中找不到 gdcm 包.所以你的包没有正确安装,和/或你的环境没有正确配置.请尝试以下操作:
- 删除pipenv
- 确保import gdcm"适用于正常"python 环境.
如果它不起作用,您知道问题出在(也)其他地方:
确保您的 PYTHONPATH 设置正确并且 gdcm 位于那里(请参阅此答案)>
一旦它在您的正常环境中工作,请确保 您已阅读并理解 pipenv 文档 并重新安装 pipenv 并配置您的环境
I'm on Ubuntu 16.04 and have been trying like crazy to install GDCM so I can use it with Python. I have pipenv
installed, and I suspect that's causing issues.
I did sudo apt-get install libgdcm2.6 python-gdcm
. It seems to install fine, but when I run python
and then import gdcm
, it complains there's no module named gdcm
.
Has anyone come across this?
This means that the python cannot find the gdcm package within its environment. So your package is not installed properly, and/or your environment has not been configured correctly.Try the following:
- remove pipenv
- make sure "import gdcm" works with a 'normal' python environment.
if it does not work you know the problem lies (also) somewhere else:
make sure your PYTHONPATH is set correctly and that gdcm is located there (see this answer)
Once it works in your normal environment make sure you have read and understand the pipenv documentation and reinstall pipenv and configure your environment
这篇关于如何使用 Python 包装器安装 GDCM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!