除非在导入pyplot之前,否则不会导入Scipy.signal

时间:2016-06-27 21:34:48

标签: python windows matplotlib scipy

这太奇怪了。每次导入时,这会以两种不同的方式失败

>>> import scipy.signal
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import scipy.signal
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\signal\__init__.py", line 282, in <module>
    from .bsplines import *
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\signal\bsplines.py", line 12, in <module>
    from scipy.special import comb, gamma
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\__init__.py", line 627, in <module>
    from ._ufuncs import *
  File "scipy\special\_ufuncs.pyx", line 1, in init scipy.special._ufuncs (scipy\special\_ufuncs.c:26242)
ImportError: DLL load failed: The specified module could not be found.
>>> import matplotlib.pyplot
>>> import scipy.signal
Traceback (most recent call last):
  File "<pyshell#7>", line 1, in <module>
    import scipy.signal
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\signal\__init__.py", line 282, in <module>
    from .bsplines import *
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\signal\bsplines.py", line 12, in <module>
    from scipy.special import comb, gamma
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\__init__.py", line 629, in <module>
    from .basic import *
  File "C:\Users\ewwieser\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\special\basic.py", line 14, in <module>
    from ._ufuncs import (ellipkm1, mathieu_a, mathieu_b, iv, jv, gamma, psi, zeta,
ImportError: cannot import name 'ellipkm1'

虽然这很好(在新壳中):

>>> import matplotlib.pyplot
>>> import scipy.signal
>>> 

我的设置是:

  • Windows上的Python 3.5.1 x64
  • Numpy 1.11.0(从~gohlke安装)
  • Scipy 0.17.1(从~gohlke安装)
  • Matplotlib 1.5.1(直接与pip install matplotlib安装)

为什么进口相互依赖?怎么可能呢?

0 个答案:

没有答案