Prophet: Easter import error

Created on 27 Jan 2020  ·  23Comments  ·  Source: facebook/prophet

In the latest version of the holidays package (0.10.1), structure was completely changed, whereas we are calling https://github.com/facebook/prophet/blob/master/python/fbprophet/hdays.py#L14 directly from the holidays.

Please see the details of the holidays' version update.
https://github.com/dr-prodigy/python-holidays/commit/721ebbc35ecadf935ec840e802890a408ef650fc#diff-d016b20073c1e0616393552c13b2647b

Most helpful comment

The change in imports in the holidays package has unfortunately broken importing fbprophet. We'll push out a new version to pip stat that fixes it; in the meantime, there are two options:

  1. Downgrade holidays to 0.9.12, with pip install holidays==0.9.12
  2. Install fbprophet from this repository, by cloning it and running python3 setup.py install

All 23 comments

A temporary solution is defining max version limit for holidays https://github.com/facebook/prophet/pull/1294
I'll be updating according to latest package, soon

holidays==0.9 worked fine for me using prophet ==0.4

Not really advisable, but I was able to get it working by removing the easter and rd imports in the days.py file

Hi, here
dr-prodigy/python-holidays#277
you'll find a fix for this issue, which is deriving from a wrong reference made to easter, which is not part of holidays.

The change in imports in the holidays package has unfortunately broken importing fbprophet. We'll push out a new version to pip stat that fixes it; in the meantime, there are two options:

  1. Downgrade holidays to 0.9.12, with pip install holidays==0.9.12
  2. Install fbprophet from this repository, by cloning it and running python3 setup.py install

Is there any fix of the issue? because I am still getting this error.

Is there any fix of the issue? because I am still getting this error.

@bletham's solution (downgrading holidays or installing prophet from repo) should be working, isn't they?

Having the same issue using fbprophet on a cluster on databricks. Is the pypi update expected soon? If not does anyone have any suggestions of how to build the repo for use on a databricks cluster.

@bletham work for me, I just needed to restart de terminal

downgrading holidays using pip install holidays==0.9.12, by itself, worked for me

What is the status of the fix for this. I've installed using anaconda, and would prefer not mixing pip and anaconda package managers for a temporary bandaid.

As of yesterday, the fix has been pushed to both PyPI and conda forge in the new version (0.6). Please upgrade the package and then you should no longer have this error.

If you do run into this error, make sure that you are using the latest version (0.6):

import fbprophet
print(fbprophet.__version__)

I have just installed fbprophet but get the same issue with holidays. I also downgraded holidays but it didn't help. Any other suggestions?

@avissens can you check what version you are using?

import fbprophet
print(fbprophet.__version__)

I also just downloaded fbprophet yesterday and i am having the same issues. I used the conda forge method and i also downgraded the holiday package but it still doesnt work.

@jankomah can you check what version you are using?

import fbprophet
print(fbprophet.__version__)

@bletham My version is 0.5.

@avissens you need to upgrade to v0.6. If you upgrade via pip or conda forge that should be what you get (unless you're using Python2, in which case let me know).

current fresh install of conda forge has this same problem:
conda install -c conda-forge fbprophet - > fbprophet 0.5
ImportError: cannot import name 'easter' from 'holidays'

current fresh install of conda forge has this same problem:
conda install -c conda-forge fbprophet - > fbprophet 0.5
ImportError: cannot import name 'easter' from 'holidays'

conda-forge still pointing to 0.5 but pip points to 0.6
I had to
pip install fbprophet --upgrade
to get 0.6

conda forge has prophet==0.6 since Feb: https://github.com/conda-forge/fbprophet-feedstock/commit/6de225d6d7086bb5fe8e13ed6da6561b2fc951fe
is there an issue with python versions or some other package conflict?

conda forge has prophet==0.6 since Feb: conda-forge/fbprophet-feedstock@6de225d
is there an issue with python versions or some other package conflict?

Conda MacOSX: conda 4.8.3
Python: Python 3.7.6

Here is a snip of what I get from conda-forge. I suspect is due to the failed frozen environment solve. However, pip allowed me to continue my work.

`conda install -c conda-forge fbprophet

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

Package Plan

[...]

added / updated specs:
- fbprophet

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
[...]
fbprophet-0.5              |   py37h6de7cb9_0         631 KB  conda-forge
holidays-0.10.2            |     pyh9f0ad1d_0          59 KB  conda-forge
[...]
------------------------------------------------------------
                                       Total:       243.5 MB

The following NEW packages will be INSTALLED:

[...]
fbprophet conda-forge/osx-64::fbprophet-0.5-py37h6de7cb9_0
holidays conda-forge/noarch::holidays-0.10.2-pyh9f0ad1d_0
[...]`

hm I have a pretty shallow understanding of conda forge so I'm really not sure why it isn't picking up 0.6. But glad to hear it's working with pip in any case!

Was this page helpful?
0 / 5 - 0 ratings