Not able to import numpy in cygwin

烈酒焚心 提交于 2019-12-25 09:00:08

问题


I have installed numpy using the cygwin setup, and it is showing as successfully installed. But I am not able to import it in my program.

Traceback (most recent call last):
File "pythonpath.py", line 1, in <module>
import numpy
File "/usr/lib/python2.7/site-packages/numpy/__init__.py", line 170, 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 18, in <module>
from .polynomial import *
File "/usr/lib/python2.7/site-packages/numpy/lib/polynomial.py", line 19, in <module>
from numpy.linalg import eigvals, lstsq, inv
File "/usr/lib/python2.7/site-packages/numpy/linalg/__init__.py", line 51, in <module>
from .linalg import *
File "/usr/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 29, in <module>
from numpy.linalg import lapack_lite, _umath_linalg
ImportError: No such file or directory

I checked and found that both lapack_lite.dll and _umath_linalg.dll are available under /lib/python2.7/site-packages/numpy/linalg

When I try to reinstall numpy, I get the following message:

$ pip install numpy
Requirement already satisfied: numpy in /usr/lib/python2.7/site-packages

The package is also up-to-date.

 $ pip install numpy --upgrade
 Requirement already up-to-date: numpy in /usr/lib/python2.7/site-packages

How do I import numpy in my programs?


回答1:


I simply restarted my system and the error went away!



来源:https://stackoverflow.com/questions/42320132/not-able-to-import-numpy-in-cygwin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!