Windows 7的导入scipy.stats错误

时间:2016-04-08 00:26:04

标签: python-3.x scipy python-import

我使用Windows 7并安装了python 3.5 32bit。我从http://www.lfd.uci.edu/~gohlke/pythonlibs/为python 3.5安装了numpy 1.11 + mkl win32 whl版本 并以同样的方式从同一站点安装scipy 0.17.0。我用pip install。没有问题导入numpy和scipy,但是在导入scipy.stats或scipy import stats等时看到错误...这是错误消息:

如果来自scipy import stats:

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    from scipy import stats
  File "C:\Programs\Python\Python35-32\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
    from .stats import *
  File "C:\Programs\Python\Python35-32\lib\site-packages\scipy\stats\stats.py", line 180, in <module>
    import scipy.special as special
  File "C:\Programs\Python\Python35-32\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 scipy.stats,请参阅以下错误消息:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    import scipy.stats
  File "C:\Programs\Python\Python35-32\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
    from .stats import *
  File "C:\Programs\Python\Python35-32\lib\site-packages\scipy\stats\stats.py", line 180, in <module>
    import scipy.special as special
  File "C:\Programs\Python\Python35-32\lib\site-packages\scipy\special\__init__.py", line 629, in <module>
    from .basic import *
  File "C:\Programs\Python\Python35-32\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'

我搜索过网站的解决方案但找不到答案。请帮忙。这真是令人沮丧......   谢谢 落基

1 个答案:

答案 0 :(得分:3)

好的,最后我自己解决了这个问题。一开始我知道我需要2015视觉C ++重新分配并安装它,问题是我安装了64位,而显然我应该使用32位,因为我的python和numpy,scipy都是32位。   希望这对其他人有帮助