今天我遇到了一个奇怪的错误。我尝试在 Windows 7 下的网络驱动器上的 ipython 中导入 numpy,但失败并出现以下错误。
In [1]: import numpy
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Z:\<ipython-input-1-5a0bd626bb1d> in <module>()
----> 1 import numpy
C:\Python27\lib\site-packages\numpy\__init__.pyc in <module>()
141 return loader(*packages, **options)
142
--> 143 import add_newdocs
144 __all__ = ['add_newdocs']
145
C:\Python27\lib\site-packages\numpy\add_newdocs.py in <module>()
7 # core/fromnumeric.py, core/defmatrix.py up-to-date.
8
----> 9 from numpy.lib import add_newdoc
10
11 ########################################################################
#######
C:\Python27\lib\site-packages\numpy\lib\__init__.py in <module>()
11
12 import scimath as emath
---> 13 from polynomial import *
14 #import convertcode
15 from utils import *
C:\Python27\lib\site-packages\numpy\lib\polynomial.py in <module>()
15 from numpy.lib.function_base import trim_zeros, sort_complex
16 from numpy.lib.type_check import iscomplex, real, imag
---> 17 from numpy.linalg import eigvals, lstsq
18
19 class RankWarning(UserWarning):
C:\Python27\lib\site-packages\numpy\linalg\__init__.py in <module>()
46 from info import __doc__
47
---> 48 from linalg import *
49
50 from numpy.testing import Tester
C:\Python27\lib\site-packages\numpy\linalg\linalg.py in <module>()
21 isfinite, size, finfo, absolute, log, exp
22 from numpy.lib import triu
---> 23 from numpy.linalg import lapack_lite
24 from numpy.matrixlib.defmatrix import matrix_power
25 from numpy.compat import asbytes
ImportError: DLL load failed: The specified path is invalid.
使用原始 python shell 和在 C:\ 驱动器上使用 ipython 一样有效。我尝试重新安装 ipython 并尝试了不同的版本,但错误仍然存在。我不知道这是什么原因,所以任何帮助表示赞赏。