question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The fit method do not work with pystan==2.17.0.0

See original GitHub issue
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-16-0235c1cd9218> in <module>()
----> 1 m.fit(serie);

~/.pyenv/versions/3.6.2/envs/manhattan/lib/python3.6/site-packages/fbprophet/forecaster.py in fit(self, df, **kwargs)
    832             try:
    833                 params = model.optimizing(
--> 834                     dat, init=stan_init, iter=1e4, **kwargs)
    835             except RuntimeError:
    836                 params = model.optimizing(

~/.pyenv/versions/3.6.2/envs/manhattan/lib/python3.6/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()

stanfit4anon_model_1fdd477dd8bcc50395c4e25c8741f1c1_7672185744958054027.pyx in stanfit4anon_model_1fdd477dd8bcc50395c4e25c8741f1c1_7672185744958054027.StanFit4Model.__init__()

TypeError: __init__() takes exactly 1 positional argument (2 given)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
kirankunapulicommented, Nov 2, 2017

I received the same error TypeError: __init__() takes exactly 1 positional argument (2 given) and pip install -U fbprophet didn’t resolve the issue under Python 3.6.3 :: Anaconda, Inc. but introduced a Cython error!

I used the following commands to finally get it working,

pip uninstall fbprophet pystan
pip --no-cache-dir install pystan==2.17
pip --no-cache-dir install fbprophet==0.2
conda install Cython --force
3reactions
dbricarecommented, Oct 16, 2017

Received this same error on my system with fbprophet updated from 0.1.1 to 0.2, and python 3.5 while using jupyter. Running sudo pip3 install -U fbprophet didn’t resolve the issue for me. I found two possible workarounds though.

  • Keep the existing fbprophet 0.2 install and rollback pystan 2.17 to 2.14:
sudo -H pip3 install -U pystan==2.14

Or

  • Uninstall fbprophet 0.2, delete the cached wheel, install pystan 2.17, then reinstall fbprophet with pip:
sudo -H pip3 uninstall fbprophet pystan
sudo rm /path/to/fbprophet*.whl
sudo -H pip3 install pystan==2.17
sudo -H pip3 install fbprophet==0.2

Haven’t tested this thoroughly but the fit error did go away.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's New — PyStan 2.19.1.1 documentation
Fit method to_dataframe organizes draws into a Pandas DataFrame. Only works if Pandas is installed. Thanks to Liam Brannigan and Ari Hartikainen ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found