Python中安装Prophet

1. 先安装pystan依赖

按照https://pystan.readthedocs.io/en/latest/windows.html说明,请使用如下命令

conda install libpython m2w64-toolchain -c msys2
conda install matplotlib scipy pandas -c conda-forge
pip install pystan
 
安装好后使用如下python代码测试一下是否好用,如果结果不是接近0或有报错,可能是pystan安装失败导致。
Test if pystan install successful:
import pystan
model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
model = pystan.StanModel(model_code=model_code)  # this will take a minute
y = model.sampling(n_jobs=1).extract()['y']
y.mean()  # should be close to 0
 
2.安装Prophet
pip install fbprophet         
                                                
如果使用conda可以用下面命令选择conda-forge源,我试了不成功。
conda install -c conda-forge fbprophet 
conda install -c conda-forge/label/cf201901 fbprophet
原文地址:https://www.cnblogs.com/zenghanxi/p/10477543.html