Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name ellipkm1

Tags:

python

scipy

I was trying to import scipy.stats, however keep getting the error of 'ImportError: cannot import name ellipkm1'

Here's the complete track record of the error:

Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\ArcGIS10.2\lib\site-packages\scipy\stats\__init__.py", line 321, in <module>
    from .stats import *
  File "C:\Python27\ArcGIS10.2\lib\site-packages\scipy\stats\stats.py", line 180, in <module>
    import scipy.special as special
  File "C:\Python27\ArcGIS10.2\lib\site-packages\scipy\special\__init__.py", line 603, in <module>
    from .basic import *
  File "C:\Python27\ArcGIS10.2\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

So what should I do to fix this problem?

like image 395
Sui Avatar asked Jul 29 '15 06:07

Sui


1 Answers

I had to upgrade:

pip install scipy --upgrade

to scipy==0.16.1 to make it work. Note that I had uninstalled scipy from root and installed it in a virtualenv.

Also, If you want to use the same version of scipy, you can run:

pip install -U --force-reinstall scipy

I had scipy==0.15.1 and the command above fixed it.

like image 148
max Avatar answered Sep 29 '22 17:09

max