Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

While importing auto_arima from pmdarima: ERROR : cannot import name 'factorial' from 'scipy.misc'

I have python 3.7.1 and scipy version : 1.3.0. I'm getting error while calling auto_arima saying : "cannot import name 'factorial' from 'scipy.misc'"

Just this basic import causes the issue:-
"from pmdarima.arima import auto_arima"
I've tried reinstalling scipy, didn't work

like image 852
Crossfit_Jesus Avatar asked May 19 '19 09:05

Crossfit_Jesus


1 Answers

The function factorial was moved from scipy.misc to scipy.special. The version in scipy.misc has been deprecated for a while, and it was removed in scipy 1.3.0. Something in pmdarima or one of its dependencies is still using the name scipy.misc.factorial.

The culprit appears to be statsmodels 0.9.0. pmdarima depends on statsmodels, and there is code in statsmodels 0.9.0 that imports scipy.misc.factorial. The development version of statsmodels has a fix for that, but 0.9.0 is the latest release. The problem should be fixed if you upgrade statsmodels to version 0.10 or later.

The statsmodels developers are aware of the issue; see

  • https://github.com/statsmodels/statsmodels/issues/5620
  • https://github.com/statsmodels/statsmodels/issues/5747
like image 73
Warren Weckesser Avatar answered Oct 13 '22 00:10

Warren Weckesser