2017-02-22 23:59:43 +00:00
---
layout: docs
docid: "installation"
title: "Installation"
permalink: /docs/installation.html
2018-11-13 18:17:59 +00:00
subsections:
- id: r
title: Using R
- id: python
title: Using Python
2017-02-22 23:59:43 +00:00
---
2021-03-26 04:03:05 +00:00
Prophet has two implementations: [R ](#installation-in-r ) and [Python ](#installation-in-python ).
2017-02-22 23:59:43 +00:00
2018-11-13 18:17:59 +00:00
< a href = "#r" > < / a >
2021-05-11 15:39:20 +00:00
## Installation in R
2020-05-05 21:13:58 +00:00
Prophet is a [CRAN package ](https://cran.r-project.org/package=prophet ) so you can use `install.packages` .
2017-02-22 23:59:43 +00:00
2021-05-11 15:39:20 +00:00
```r
2017-02-22 23:59:43 +00:00
# R
2021-05-11 15:39:20 +00:00
install.packages('prophet')
2017-02-22 23:59:43 +00:00
```
After installation, you can [get started! ](quick_start.html#r-api )
2021-05-11 15:39:20 +00:00
#### Experimental backend - cmdstanr
You can also choose an experimental alternative stan backend called `cmdstanr` . Once you've installed `prophet` ,
follow these instructions to use `cmdstanr` instead of `rstan` as the backend:
```r
# R
# We recommend running this is a fresh R session or restarting your current session
install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
# If you haven't installed cmdstan before, run:
cmdstanr::install_cmdstan()
# Otherwise, you can point cmdstanr to your cmdstan path:
cmdstanr::set_cmdstan_path(path = < your existing cmdstan > )
# Set the R_STAN_BACKEND environment variable
Sys.setenv(R_STAN_BACKEND = "CMDSTANR")
```
2017-02-22 23:59:43 +00:00
### Windows
2022-05-24 12:24:32 +00:00
On Windows, R requires a compiler so you'll need to [follow the instructions ](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows ) provided by `rstan` . The key step is installing [Rtools ](http://cran.r-project.org/bin/windows/Rtools/ ) before attempting to install the package.
2017-02-22 23:59:43 +00:00
2017-07-29 05:35:33 +00:00
If you have custom Stan compiler settings, install from source rather than the CRAN binary.
2018-11-13 18:17:59 +00:00
< a href = "#python" > < / a >
2017-02-22 23:59:43 +00:00
## Installation in Python
2022-06-24 22:21:57 +00:00
Prophet is on PyPI, so you can use `pip` to install it.
2017-02-22 23:59:43 +00:00
2021-05-11 15:39:20 +00:00
```bash
2022-06-24 22:21:57 +00:00
python -m pip install prophet
2017-02-22 23:59:43 +00:00
```
2022-06-24 22:21:57 +00:00
* From v0.6 onwards, Python 2 is no longer supported.
* As of v1.0, the package name on PyPI is "prophet"; prior to v1.0 it was "fbprophet".
* As of v1.1, the minimum supported Python version is 3.7.
2021-05-11 15:39:20 +00:00
2017-02-22 23:59:43 +00:00
After installation, you can [get started! ](quick_start.html#python-api )
2017-04-24 23:35:56 +00:00
### Anaconda
2023-05-28 13:31:47 +00:00
Prophet can also be installed through conda-forge.
```bash
conda install -c conda-forge prophet
```