6

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
  • 29,564
  • 18
  • 109
  • 144
Toly
  • 2,473
  • 7
  • 22
  • 32
  • 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

6 Answers6

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
  • 603
  • 7
  • 6
5

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,584
  • 2
  • 17
  • 29
3

I found an answer her:

Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) by Sushant Chaudhary

Thank you!!

Toly
  • 2,473
  • 7
  • 22
  • 32
2

Try installing fbprophet

pip install fbprophet

Or

pip3 install fbprophet

Computer's Guy
  • 4,557
  • 7
  • 49
  • 72
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
2

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