-
Notifications
You must be signed in to change notification settings - Fork 1
Installation Facebook Prophet (for Python)
The facebook's Prophet package is available for both R and Python languages. All the information on this page are instructions to install the Prophet package for Python, package called 'fbprophet'.
The organization of this page is as described as below:
- On Windows Operating System
- Steps
- Common Issue
- On Linux Operating System
- Steps
- Common Issues
The installation on windows operating system is quite simple as Prophet is made available on PyPI. PyPI is python package index that maintains the packages. The python's popular Package manager pip uses PyPI as the default source for packages and their dependencies. Getting and installing the package can thus be done using pip.
The requirements for Prophet are:
Cython >=0.22
Pystan >=2.14
Numpy >=1.10.0
Pandas >=0.18.1
Matplotlib >=2.0.0
These dependencies are resolved and fetched by pip. We just need to run the command,
pip install fbprophet.
But not too fast. Installing Prophet involves executing the stan models which require C, C++ compilers to be installed. These latest version compilers can be downloaded from here. Once the compilers are installed, we are good to go.
- Download the C++ compilers from this link. Install the compilers.
- If there is no python installed on the machine, download and install it from here. Be aware that, for pystan to work, we need python version to be at least 3.5
- Now that we have installed python and thus pip, we can use pip to install Prophet. Open up a command prompt and type in
pip install fbprophet.
And you should be done installing Prophet.
- The key step is to download and install the latest version of C and C++ compilers, which when not done results in error while installing prophet.
Installing prophet on linux is a bit more involved. This is because prophet requires latest C and C++ compilers installed and the default versions available at this time do not really help in the installation. Note that the below commands for installation are specific to Amazon Linux Image made available by amazon. This works for linux with yum installer.
- Downloading and installing the latest gcc and gcc++ compilers. At this time, the default gcc and gcc++ compilers' versions are 4.8. But prophet does not work well with them and hence we need to install the latest versions manually. Uninstall any gcc and gcc++ compilers installed. Now use the following commands to install the latest versions of the compilers.
yum install gcc64
yum install gcc64-c++
- If python is not already installed on the machine we need to install it first. We can search for available python versions using the following command,
yum search python3
From the list of available versions choose and install the latest. For example, at this time, python3.6 is latest version available. It can be installed using the command, yum install python36.x86_64
- We need to have python development tools installed on the machine to install the Prophet. It can be installed by using the following command,
yum install python-devel
- Now that all the requirements are satisfied, we can go ahead and install the package fbprophet. This can be done using the following command,
pip install fbprophet
-
The documentation specifies a requirement of 4GB memory (RAM). If the machine you are trying to install on, does not have at least 4GB RAM, prophet will not install. The compilation of the stan model fails.
-
Be sure to uninstall any version of C and C++ compilers present and then install latest versions. If both versions installed, the cython might throw an error.