最近开发同事让我装几个包,scipy、gensim、theano、sklearn.....几个包装完后,发现导入报错,具体如下:

from ._ufuncs import (ellipkm1, mathieu_a, mathieu_b, iv, jv, gamma,
ImportError: cannot import name '_zeta'

通过某度搜了好久愣是没发现解决办法,后来直接出去,用Google搜索,直接提示scipy版本问题,更新即可,

Sounds like you have an old version of special._ufuncs--the function zeta in there was renamed to_zeta somewhat recently. What happens if you completely uninstall SciPy and then reinstall a fresh version? (Also, what version of SciPy are you using?)

这里真的不得不吐槽一把....

[root@localhost~]# pip uninstall scipy

[root@localhost~]# pip install -U scipy

后面的安装过程大概需要10分钟左右,最终结果为:

  Could not find .egg-info directory in install record for scipy from https://pypi.python.org/packages/22/41/b1538a75309ae4913cdbbdc8d1cc54cae6d37981d2759532c1aa37a41121/scipy-0.18.1.tar.gz#md5=5fb5fb7ccb113ab3a039702b6c2f3327 in /usr/local/lib/python2.7/site-packages

Successfully installed scipy

Cleaning up...

[root@localhost~]# python

Python 2.7.10 (default, Dec 22 2016, 14:45:25) 

[GCC 4.8.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import scipy

>>> import gensim

>>> import theano

>>> import sklearn

>>> exit

Use exit() or Ctrl-D (i.e. EOF) to exit

>>> exit()

[root@localhost ~]#