0

尝试在 Scientific Linux 中进行模拟时,我遇到了以下错误。

$ python plot_distribt.py
Loaded libmkl_rt.so for dgesvd
Loaded libmkl_rt.so for zgesvd
Traceback (most recent call last):
  File "plot_distribt.py", line 32, in <module>
    from mps.mps import iMPS
  File "/work/wangb/DMRG/mps/mps.py", line 13, in <module>
    from algorithms.linalg import np_conserved as npc
  File "/work/wangb/DMRG/algorithms/linalg/np_conserved.py", line 294, in <module>
    from algorithms.linalg import npc_helper
  File "__init__.pxd", line 164, in init npc_helper
ValueError: numpy.dtype has the wrong size, try recompiling. Expected 88, got 96

创建虚拟环境后,我可以通过 升级包pip2 install --upgrade numpy --user python,现在我有 numpy-1.16.6、scipy-1.2.3 和 pandas-0.24.2。但是,还是出现了上面的ValueError。

我还检查了在新创建的环境中打开 python,我得到了

Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 22:42:48)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.version.version
'1.7.1'
>>> numpy.__file__
'/usr/lib64/python2.7/site-packages/numpy/__init__.pyc'
>>>

因此,关键可能是如何避免使用 numpy-1.7.1?请注意,我无法更改任何内容,/usr/lib64/python2.7/site-packages因为我使用的是我们大学的集群系统。

提前非常感谢!

4

0 回答 0