8

Can someone explain how to install Prophet on Python3?

I tried pip install fbprophet but it did not work.

Tried to do this in the notebook after importing pandas and sklearn and got another error:

import pandas as pd
import sklearn as sk
from fbprophet import Prophet
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-4-f503e9c6cf11> in <module>()
----> 1 from fbprophet import Prophet

ModuleNotFoundError: No module named 'fbprophet'
smci
  • 32,567
  • 20
  • 113
  • 146
Toly
  • 2,981
  • 8
  • 25
  • 35
  • If you really typed `pip install fbprohet`, that has a typo (missing p) so it won't work. What does `pip list` (List installed packages) show? – smci Jun 12 '18 at 02:11
  • the typo is here not in install. My fault. – Toly Jun 12 '18 at 02:32
  • the list is way too long – Toly Jun 12 '18 at 02:34
  • 1
    Failed building wheel for fbprophet Running setup.py clean for fbprophet Failed to build fbprophet Installing collected packages: pystan, fbprophet Running setup.py install for fbprophet ... error running install running build running build_py creating build creating build\lib creating build\lib\fbprophet creating build\lib\fbprophet\stan_model error: Microsoft Visual C++ 14.0 is required. – Toly Jun 12 '18 at 02:36
  • If the typo is here, then fix it. Typos in questions are no use to anyone. – PM 2Ring Jun 12 '18 at 02:49
  • Do you have Microsoft Visual C++ 14.0 ? – PM 2Ring Jun 12 '18 at 02:50
  • Did you install pystan first, as mentioned in the fbprophet instructions? https://github.com/facebook/prophet/blob/master/README.md – PM 2Ring Jun 12 '18 at 03:02
  • Typo has been already corrected. Pystan was installed. Not sure about Visual C++ – Toly Jun 12 '18 at 03:21
  • you need to install pystan first – Pablohoney Nov 22 '20 at 10:47

8 Answers8

9

First you have to Install c++ compiler, you can install c++ compiler with below command -

conda install libpython m2w64-toolchain -c msys2

Once c++ compiler installed you have to install pystan, to install pystan you can use below command

pip install pystan

Finally, now we are ready to install facebook prophet -

pip install fbprophet

Hope this is helpful..

For more details follow this link - https://facebook.github.io/prophet/docs/installation.html

Brijesh Rana
  • 621
  • 7
  • 6
6

Easiest way is to install fbprophet :

conda install -c conda-forge fbprophet

This will download all the needed packages first.

Then ->

  conda install -c conda-forge/label/cf201901 fbprophet
Lucifer
  • 1,594
  • 2
  • 18
  • 32
Al Jaber Nishad
  • 111
  • 2
  • 2
3

Try installing fbprophet

pip install fbprophet

Or

pip3 install fbprophet

Computer's Guy
  • 5,122
  • 8
  • 54
  • 74
3

I had relatively similar problem, but my error was it couldn't import pystan which in installed using pip install pystan. so the problem was fbprophet doesn't support latest version of pystan so uninstall previous one and install older version of pystan.

pip install pystan==2.19.1.1 pip install fbprophet

https://facebook.github.io/prophet/docs/installation.html

2

On Windows it's easier using anaconda or miniconda, just give

conda install pystan

and it will install all the needed dependencies, included the c++ compiler, then

pip install fbprophet

in Linux systems, for example, ubuntu, a simple

pip install pystan
pip install fbprophet 

should work, without installing anaconda/miniconda

Pablohoney
  • 104
  • 10
0

!pip install pystan==2.19.1.1 fbprophet ##### i was trying to install fbprophet==0.7.1 but in the presence of cmdstanpy==0.9.5 it was unable to build the wheel for fbprophet. after executing the above command for installing pystan==2.19.1.1 collectively with fbprophet successfully installed cmdstanpy-0.9.5 fbprophet-0.7.1 note that there is no version specified for fbprophet in the command and pystan is specified with version 2.19.1.1 to avoid dependency conflicts.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 20 '22 at 01:12
0

This worked for me. pip3 was a must!

pip3 install pystan 
pip3 install fbprophet
0

I had this problem and I have been trying to solve it for two days now I found out that fbprophet is no longer being maintained and that's why pip install fbprophet does not work.

do pip install prophet instead

if you want to import after installation: from prophet import Prophet

Axisnix
  • 2,822
  • 5
  • 19
  • 41