Rocky
Rocky

Reputation: 93

error of import scipy.stats for windows 7

I use windows 7 and installed python 3.5 32bit. I installed numpy 1.11 + mkl win32 whl version for python 3.5 from http://www.lfd.uci.edu/~gohlke/pythonlibs/ and installed scipy 0.17.0 from the same site same way. I use pip install. No problem import numpy and scipy, but see error when import scipy.stats or from scipy import stats, etc... Here is the error message:

if from 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.

If use import scipy.stats see below error message:

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'

I have searched for solution from websites but could not find an answer. Please help. This is really frustrating... Thanks Rocky

Upvotes: 3

Views: 1321

Answers (1)

Rocky
Rocky

Reputation: 93

Ok, finally I solved this myself. At the beginning I knew I needed the 2015 visual C++ redistribution and had it installed, the problem is I installed the 64bit one while obviously I should have used 32 bit one since my python and numpy, scipy were all 32 bit. Hope this helps for other people

Upvotes: 3

Related Questions