我正在 Cygwin 中尝试import numpy
。我收到以下错误消息。
我已经通过 Cygwin 安装程序安装了 ,numpy 1.11.2-1
也就是该python2-numpy: Python scientific computing module
软件包。我还有Python 2.7.14-1
,也就是该python2: Python 2 language interpreter
软件包也是通过 Cygwin 安装的。我的机器上没有本地安装 Python。
$ python
Python 2.7.14 (default, Oct 31 2017, 21:12:13)
[GCC 6.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: No such file or directory
似乎有很多关于这个问题的帖子,但都没有适合我的解决方案。我尝试重新启动我的电脑https://stackoverflow.com/questions/42320132/not-able-to-import-numpy-in-cygwin,但这没有作用。
我还编辑了我的$PATH
变量:
$ echo $PATH
/usr/lib/python2.7/site-packages/numpy/:/usr/lib/python2.7/site-packages/:/usr/bin