6

I have tried to install Facebook Prophet in Anaconda on Ubuntu following the instructions at:

https://facebook.github.io/prophet/docs/installation.html#installation-in-python.

In Anaconda Navigator, when I click on the environment, fbprophet is listed along with the other installed packages. The problem is that when I try to use fbprophet in Jupyter:

from fbprophet import Prophet

I get an error: "ModuleNotFoundError: No module named 'fbprophet'". It's bizarre because the fbprophet package seems to be installed in my environment according to Anaconda.

Can anyone help, please?

Thanks!

  • maybe you have selected the wrong kernel in your jupyter session? click on "python3" in the top right corner and look if your environment shows up in the drop down menue – kjul Apr 21 '20 at 22:09
  • Does this answer your question? [How to install fbprophet for Python 3.7 (anaconda distribution)](https://stackoverflow.com/questions/55078483/how-to-install-fbprophet-for-python-3-7-anaconda-distribution) – Gonçalo Peres Nov 17 '20 at 15:24
  • This one did not but the one below did. – from keras import michael Nov 18 '20 at 18:54

5 Answers5

13

It seems that you have installed the package in a separate environment in anaconda. I think when you are running jupyter notebook, it is running from the base environment, But actually you need to run it from the library environment. So if the case is this you need to install jupyter notebook in the other environment and then run the jypyter notebook from that environment. So at first make sure that you have installed jupyter notebook correctly on the appropriate environment. If you have installed it correctly then open jupyter notebook and in a code cell write the following commands and execute the cell.

First, execute this command in a code cell-

!conda install -c conda-forge fbprophet -y

Then in another code cell execute this command-

!pip install --upgrade plotly

Now try to import the library.

Tanmoy Datta
  • 1,604
  • 1
  • 17
  • 15
5

Recently the fbprophet project renamed to prophet. If you are referring to it using old name you should install the old version.

pip/conda/mamba/whatever install prophet
4

For people coming from a Jupyter Notebook, use:

%pip install prophet

as suggested in https://facebook.github.io/prophet/docs/installation.html.

It's also stated that:

As of v1.0, the package name on PyPI is “prophet”; prior to v1.0 it was “fbprophet”.

gsamaras
  • 71,951
  • 46
  • 188
  • 305
  • Another wake up here - calling Prophet from prophet must look like prophet.Prophet() The name change is weird. – jamiel22 Apr 28 '23 at 15:29
  • @jamiel22 fair point, but personally I do `from prophet import Prophet` and then `m = Prophet()`, which is okay IMHO. – gsamaras Apr 28 '23 at 16:17
2

After spending hours scouring the internet for answers to this question and similar questions like "ERROR: Command errored out with exit status 1: when installing "Facebook" "prophet"" what worked for me was quite simply using a sudo pip install at the terminal prompt:

$ sudo pip install pystan==2.19.1.1 prophet

After install using prophet instead of fbprophet:

from prophet import Prophet

Credit to GitHub issue 1874 - https://github.com/facebook/prophet/issues/1874

iraseidman
  • 21
  • 1
1

Window10 + Pycharm. This works with Python 3.8. and Python 3.9.x:

pip install localpip 
localpip install fbprophet
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
kiki
  • 11
  • 1