"ImportError: No module named oldnumeric" when running PMV from mgltools

"ImportError: No module named oldnumeric" when running PMV from mgltools

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

conda install mgltools

当我尝试使用命令 pmv 测试安装时,出现以下错误

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 369, in runPmv
    from mglutil.splashregister.splashscreen import SplashScreen
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/mglutil/splashregister/splashscreen.py", line 7, in <module>
    from mglutil.util.misc import ensureFontCase
  File "/home/satyajeet/miniconda2/MGLToolsPckgs/mglutil/util/misc.py", line 19, in <module>
    import numpy.oldnumeric as Numeric
ImportError: No module named oldnumeric
hit enter to continue

从网上论坛,我发现是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

已按照描述解决。但是现在如果我尝试执行 pmv 的新错误是..

ValueError: Attempted relative import in non-package

MGLtools 看起来被遗弃了,its conda package is unusable. The latest release was in 2012, the download page of the official site was last updated in 2015,依此类推。

如您所见,conda 包与其他包的最新版本不兼容,并且根据 the files for download 的内容判断,它是为 Python 2.5(!) 构建的。

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

您只能使用 conda 安装包,因为它的元数据(.tar.gz 中的 info/index.json)没有指定(根本)它的依赖项。

因此,如果您仍想尝试一下,最好的办法是尝试从官方下载包进行独立安装 Downloads — MGLTools. 这些软件包包括 Python 和其他依赖项的必要版本。