OS: Windows 7 Professional
First of all, I have read through related threads #249 #252 and #599, but still cannot figure out how to solve this issue.
I understand that the easiest way to install fbprophet is to run
conda install -c conda-forge fbprophet
but for reasons I don't know, it takes forever for conda to solve the environment. It's not the case if I use conda to install other packages.
So instead I used pip and it reported that fbprophet 0.4 was installed successfully. But I then got the following error message when importing fbprophet
WARNING:pystan:No module named 'stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969'
WARNING:pystan:Something went wrong while unpickling the StanModel. Consider recompiling.
Before installing fbprophet, I followed this instruction to install pystan and checked that pystan is working properly. By running the following code.
import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code) # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean() # should be close to 0
I got message like
Gradient evaluation took 0 seconds
1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
Adjust your expectations accordingly!
Iteration: 1 / 2000 [ 0%] (Warmup)
Iteration: 200 / 2000 [ 10%] (Warmup)
Iteration: 400 / 2000 [ 20%] (Warmup)
Iteration: 600 / 2000 [ 30%] (Warmup)
Iteration: 800 / 2000 [ 40%] (Warmup)
Iteration: 1000 / 2000 [ 50%] (Warmup)
Iteration: 1001 / 2000 [ 50%] (Sampling)
Iteration: 1200 / 2000 [ 60%] (Sampling)
Iteration: 1400 / 2000 [ 70%] (Sampling)
Iteration: 1600 / 2000 [ 80%] (Sampling)
Iteration: 1800 / 2000 [ 90%] (Sampling)
Iteration: 2000 / 2000 [100%] (Sampling)
Elapsed Time: 0.01 seconds (Warm-up)
0.01 seconds (Sampling)
0.02 seconds (Total)
I uninstalled both pystan and fbprophet and then reinstalled them with --no-cache flag. But fbprophet still didn't work.
I'm getting exactly the same error on OSX with fbpropeht 0.4 and pystan 2.18.0.0
Also tried re-installing with no-chache but it did not helped as reported in other tickets.
Same problem here, but with Python 3.6.7
I solved this issue by uninstalling anaconda 5.3.1 completely and installing anaconda 5.2.0, which comes with python 3.6.5. Then conda works wonders to install fbprophet.
I suspect that this is a python version issue, especially after I checked several mirrors, for example, only to see that there are no fbprophet versions matching pythoh 3.7. I guess that is why it takes forever for conda to solve the environment when python version is 3.7.0.
I tried to downgrade python 3.7 to python 3.6 by running
conda install python=3.6
but it failed because of too many dependencies. Therefore I choose to reinstall the whole anaconda.
Similar to @jiapei100 , I'm seeing this same issue with python 3.6.7, although I'm using Ubuntu 18.04 and pip to install.
I think this might be an issue with prophet 0.4, which strangely enough is listed on pypi, but not in Github as a release. It was also released yesterday.
Force downgrading to the version before seems to have before fixed things for me: pip3 install --upgrade --force-reinstall --no-cache fbprophet==0.3.post2.
I wonder if building from source might also fix things - the error message seems to suggest some prebuilt STAN model is broken.
Forcing fbprophet to 0.3.post2 worked for me as a fix.
Also failed for prophet 0.4.0, Python 3.5.2, and pystan 2.18.0.0. Rolling back to 0.3.post2 fixed the issue.
This can happen when there is a change in the model (with a new version of fbprophet, or a new version of PyStan) and pip is still using a wheel that is compiled with the old version. We just pushed a new version of fbprophet to PyPI. This should fix the issue (without having to downgrade):
pip3 uninstall fbprophet
pip3 install fbprophet --no-cache-dir --no-binary :all:
It is still not working for me.
Python 3.6.5, pystan 2.18.0.0, fbprophet 0.4
When trying to import fbprophet,
WARNING:pystan:No module named 'stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969'
WARNING:pystan:Something went wrong while unpickling the StanModel. Consider recompiling.
Facing the same problem that @ciphor related. Could someone reopen the issue ?
Using on databricks:
WARNING:pystan:No module named 'stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969'
WARNING:pystan:Something went wrong while unpickling the StanModel. Consider recompiling.
repoen the issue on the request of @vavlopes
Facing the same issue too, python 3.6, pystan and numpy newest version. Using docker for deployment. Do not see the error when doing on my local env, but when it is deployed using python 3.6 docker it returns the error and all modeling fails.
i face to the same problem , and i try to figure out why the WARNING come out ,then i found pystan generate wrong StanfitModel like this:
stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969.cpython-36m-darwin.so
but my platform is

the reason why the model generate by pystan can not be import is pystan complie wrong .so file
i face to the same problem , and i try to figure out why the WARNING come out ,then i found pystan generate wrong StanfitModel like this:
stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969.cpython-36m-darwin.so
but my platform is
the reason why the model generate by pystan can not be import is pystan complie wrong .so file
i re-install 0.3post2, this problem is solved ,pystan complie the right .so like this
stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_8575748239302698718.cpython-36m-x86_64-linux-gnu.so
I have also downgraded the package to the previous 0.3.post2. It worked but what I wanted is to upgrade the package to the newest version. I'm facing other problems, probably related to few data points in the time series, that I was hoping to fix using this new version....But yes, if you downgrade to 0.3.post2 you can still use the package.
Installing with conda install -c conda-forge fbprophetworked for me. It seems that this error is caused by some missing dependencies or incorrect version on some dependencies.
Can this issue please be reopened? I'm seeing the same issue and had to pin to 0.3.post2.
As @bletham suggested, I've found that if I install/build using pip3 install --no-cache-dir --no-binary :all: fbprophet, it works in Ubuntu 18.04 (deploying inside docker).
Unfortunately, the --no-binary :all: option does mean that all uninstalled requirements will be built from source. I found the convertdate package wasn't building, and hence, I had to install it first (pip3 install convertdate) - YMMV.
I am having exactly the same roblem when I instantiate the prophet model with:
m = Prophet()
m.fit(df)
I got:
AttributeError Traceback (most recent call last)
<ipython-input-15-1ab3c9387252> in <module>
1 m = Prophet()
----> 2 m.fit(df)
~\Anaconda3\envs\PystanandProphet\lib\site-packages\fbprophet\forecaster.py in fit(self, df, **kwargs)
~\Anaconda3\envs\PystanandProphet\lib\site-packages\pystan\model.py in optimizing(self, data, seed, init, sample_file, algorithm, verbose, as_vector, **kwargs)
470 data = {}
471 seed = pystan.misc._check_seed(seed)
--> 472 fit = self.fit_class(data, seed)
473
474 m_pars = fit._get_param_names()
AttributeError: 'StanModel' object has no attribute 'fit_class'
I tried to install fbprophet 0.3.post2, , but got the same...
Any suggestion?
I've just solved this problem before a minute by following this instruction to install gcc 64 to my computer:
https://wiki.python.org/moin/WindowsCompilers
Then create a new empty environment in Anaconda and install fbprophet directly by:
conda install -c conda-forge fbprophet
Finally it works, hope it can help :)
I had to downgrade from prophet 0.4 to 0.3 by using the prophet version included in Conda-forge
As suggested by @windmac I just created a new empty environment in Anaconda and installed fbprophet directly by using:
1) conda config --add channels conda-forge
2) conda install fbprophet
Please, notice that I did not install gcc 64 in my computer, as I had the C++ Building Tools already installed in Visual Studio 2017 !!!
Now Prophet is working OK :grin:
I am not sure why this has been closed, there doesn't seem to be a solution to use the latest 0.4 version which has the nice add_holiday functionality.
Am I missing something?
Sorry guys I built a wheel on OS X but it was not labeled correctly. I have removed it from PyPI so if you reinstall everything should be fixed.
I'm going to do a post release soon so that people's package managers are forced to upgrade. Apologies again for the inconvenience, I'm not sure why when I built the wheel that it didn't create the right file name.
Hi.
I'm still not able to import fbprophet 0.4. I got the error in holidays #792:
ImportError: cannot import name 'MONDAY'
I downgraded fbprophet to 0.3.post2, so I no longer got the holidays issue. Instead, I got the Stan error:
AttributeError: 'StanModel' object has no attribute 'fit_class'
I tried downgrading Stan, but without success.
@leonardonh see #796, this is due to a recent change in the 'holidays' package and can be fixed by downgrading that package as described in #796, while we push out the fix with the new imports.
I forgot to mention that I have already tried to downgrade holidays
!pip install holidays==0.9.8 --no-cache
and also to older versions, but couldn't manage to make it work.
Untill Thursday it was working. I'm running it on Google Colab, so you can replicate the error on the same enviroment.
Thursday is when v0.9.9 of holidays was released, but we'll push out the post release that fixes this on our side very soon.
The fix has been pushed to pypi.
pip install --upgrade fbprophet
will get things working.
Great! Thanks @bletham. It's working.
Great news....
Installed &, tested, so I can now give testimony and confirm that Prophet 0.4 is running well!!!!
:smiley: :grin: :laughing:
Post release is out. Closing the issue.
Most helpful comment
Similar to @jiapei100 , I'm seeing this same issue with python 3.6.7, although I'm using Ubuntu 18.04 and pip to install.
I think this might be an issue with prophet 0.4, which strangely enough is listed on pypi, but not in Github as a release. It was also released yesterday.
Force downgrading to the version before seems to have before fixed things for me:
pip3 install --upgrade --force-reinstall --no-cache fbprophet==0.3.post2.I wonder if building from source might also fix things - the error message seems to suggest some prebuilt STAN model is broken.