本文介绍了无法在cygwin中导入numpy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用cygwin设置安装了numpy,并且显示为已成功安装.但是我无法将其导入程序中.
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
我检查后发现/lib/python2.7/site-packages/numpy/linalg
当我尝试重新安装numpy时,收到以下消息:
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
该软件包也是最新的.
$ pip install numpy --upgrade
Requirement already up-to-date: numpy in /usr/lib/python2.7/site-packages
如何在程序中导入numpy?
How do I import numpy in my programs?
推荐答案
我只是重新启动了系统,错误消失了!
I simply restarted my system and the error went away!
这篇关于无法在cygwin中导入numpy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!