导入 numpy 时出错 - ImportError:没有名为 mtrand 的模块

导入 numpy 时出错 - ImportError:没有名为 mtrand 的模块

我已经numpy-1.11.2从源代码编译并安装如下: python setup.py install

当我尝试从 Python 导入它时,出现以下错误:

python
Python 2.7.10 (default, Mar 14 2016, 14:17:09)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/numpy-1.11.2-py2.7-linux-x86_64.egg/numpy/__init__.py", line 163, in <module>
    from . import random
  File "/usr/local/lib/python2.7/site-packages/numpy-1.11.2-py2.7-linux-x86_64.egg/numpy/random/__init__.py", line 99, in <module>
    from mtrand import *
ImportError: No module named mtrand

这里有什么问题吗?

答案1

Python 找不到您的 numpy 安装,也许您可​​以尝试使用 apt-get install python-numpy?

相关内容