StanModel' object has no attribute 'fit_class'
I have tried everything to solve this issue - all of the references I can find online are for older versions of prophet, and are a few years old:
I am trying to install using Conda on Windows 10 which the installation instructions suggested was the best way - the first attempt failed until I installed GCC (version 5.3.0) - then it installed.
Windows Version is 10.0.19043
I meet all of the requirements here - https://github.com/facebook/prophet/blob/master/python/requirements.txt
I have used the following line to install:
conda install -c conda-forge prophet
And I still get the following error - this seemed quite common a few years ago but I cannot find any recent comments about it:
WARNING:pystan:No module named 'stanfit4anon_model_dfdaf2b8ece8a02eb11f050ec701c0ec_4959769199373391054'
WARNING:pystan:Something went wrong while unpickling the StanModel. Consider recompiling.
INFO:prophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.
Traceback (most recent call last):
File "C:\Users\iwatt\Coding\prophet\main.py", line 12, in <module>
m.fit(df) # Fit the Prophet model.
File "C:\Users\iwatt\Coding\prophet\env\lib\site-packages\prophet\forecaster.py", line 1171, in fit
self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
File "C:\Users\iwatt\Coding\prophet\env\lib\site-packages\prophet\models.py", line 264, in fit
self.stan_fit = self.model.optimizing(**args)
File "C:\Users\iwatt\Coding\prophet\env\lib\site-packages\pystan\model.py", line 542, in optimizing
fit = self.fit_class(data, seed)
AttributeError: 'StanModel' object has no attribute 'fit_class'
Can anyone help?
I am having the same issure on macOS and a linux cluster. Py version 3.9.6 Could it be a python version issue or permissions issue? None of the solutions online have worked for me
I had similar problems on Linux trying to install the latest version.
What worked for me was to use Python 3.8 and use conda install -c conda-forge fbprophet (version 0.7.1) instead of prophet.
at first glance, python 3.7.6 with prophet 1.0.1 works
I am getting the same error AttributeError: 'StanModel' object has no attribute 'fit_class' with Prophet v1.0.1 (installed with conda install -c conda-forge prophet) since several months. Downgrading Python version to =< v3.8.8 solves the problem.
However I would like to switch to a more recent Python version, say v3.9.5, all other libraries that I use support it. One solution that seems to work is to build the Prophet library from the source, but I am not sure to do it properly. It would be much cleaner to install it directly from conda/pip.
Fbprophet is not compatible with Python 3.9.x yet. You need to use any older versions such as 3.8.x. Also, try to run the script as admin.