从mgltools运行PMV时,“ImportError:没有名为oldnumeric的模块”

2024-10-03 09:20:09 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用以下命令安装了一个名为mgltools的工具

conda install mgltools

当我试图使用命令pmv测试安装时,我得到了以下错误

^{pr2}$

从网上论坛上,我发现问题出在numpy版本上。oldnumeric支持在numpy 1.9之后被撤销,我正在运行numpy 1.15。所以我使用以下命令将numpy降级为numpy 1.8.1

python -m pip install numpy==1.8.1

但现在我有了一个新的错误

setting PYTHONHOME environment
Run PMV from  /home/satyajeet/miniconda2/MGLToolsPckgs/Pmv
Traceback (most recent call last):
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/Pmv/__init__.py", line 378, in runPmv
    from Pmv.moleculeViewer import MoleculeViewer
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/Pmv/moleculeViewer.py", line 21, in <module>
    from DejaVu.Geom import Geom
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/DejaVu/__init__.py", line 200, in <module>
    from Viewer import Viewer
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/DejaVu/Viewer.py", line 53, in <module>
    from DejaVu.Camera import Camera
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/DejaVu/Camera.py", line 41, in <module>
    import Image
ImportError: No module named Image
hit enter to continue

我可以使用导入图像

>>> from PIL import Image

有什么建议吗?在

pip freeze的输出

absl-py==0.5.0
alabaster==0.7.11
asn1crypto==0.24.0
Babel==2.6.0
backports-abc==0.5
backports.functools-lru-cache==1.5
certifi==2018.8.24
cffi==1.11.5
chardet==3.0.4
conda==4.5.11
cryptography==2.3.1
cycler==0.10.0
Cython==0.28.5
decorator==4.3.0
deepTools==3.1.2
dill==0.2.8.2
Django==1.11.15
dm-sonnet==1.23
docutils==0.14
enum34==1.1.6
functools32==3.2.3.post2
futures==3.2.0
idna==2.7
image==1.5.25
imagesize==1.1.0
ipaddress==1.0.22
ipython-genutils==0.2.0
Jinja2==2.10
jsonschema==2.6.0
jupyter-core==4.4.0
kiwisolver==1.0.1
MACS==1.4.2
MarkupSafe==1.0
matplotlib==2.2.3
mkl-fft==1.0.6
mkl-random==1.0.1
nbformat==4.4.0
numpy==1.8.1
numpydoc==0.8.0
oldnumeric==1.0.4
packaging==17.1
pandas==0.23.4
Pillow==5.2.0
plotly==3.2.1
Pmw==2.0.1
py2bit==0.3.0
pyBigWig==0.3.12
pycosat==0.6.3
pycparser==2.18
Pygments==2.2.0
pyOpenSSL==18.0.0
pyparsing==2.2.1
pysam==0.15.0
PySocks==1.6.8
python-dateutil==2.7.3
pytz==2018.5
requests==2.19.1
retrying==1.3.3
ruamel-yaml==0.15.46
scipy==1.1.0
singledispatch==3.4.0.3
six==1.11.0
snowballstemmer==1.2.1
Sphinx==1.8.1
sphinxcontrib-websupport==1.1.0
subprocess32==3.5.2
tornado==5.1.1
traitlets==4.3.2
typing==3.6.6
urllib3==1.23

Update 1:

按照this的建议,我设置了一个PIL模块。 我得到了

fatal error: X11/Xlib.h: No such file or directory

它的求解如here。但是现在如果我尝试执行pmv,新的错误是。。在

ValueError: Attempted relative import in non-package

Tags: infrompyimport命令numpyhomeline
1条回答
网友
1楼 · 发布于 2024-10-03 09:20:09

MGLtools看起来被抛弃了,its conda package不可用。The latest release was in 2012the download page of the official site was last updated in 2015,依此类推。在

如您所见,conda包与其他包的最新版本不兼容,并且,从the files for download的内容来看,它是为python2.5(!)构建的。在

  • 因此,即使您得到了必要的Python模块(无论它们是什么),您仍然必须根据可用的Python重新编译它,以使扩展模块可用。在

您只能安装带有conda的包,因为其元数据(.tar.gz中的^{})根本没有指定其依赖项。在

因此,如果您还想尝试一下,最好的办法是尝试从 Downloads — MGLTools.这些包包括必要的Python版本和其他依赖项。在

相关问题 更多 >