-
报错原因
使用statsmodels时,由于statsmodels和scipy版本不兼容的问题,常常报错ImportError: cannot import name 'ss'。
-
简单粗暴解决方法
pip uninstall statsmodels
pip install statsmodels -i https://pypi.tuna.tsinghua.edu.cn/simple
pip uninstall scipy
pip install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple
可能会遇到,ImportError: cannot import name 'lstsq',重新启动python即可。
Reference
https://docs.scipy.org/doc/scipy-0.19.1/reference/generated/scipy.stats.ss.html
https://stackoverflow.com/questions/54808727/python-cannot-import-name-ss#