win7 安装prophet

(1)首先安装miniconda

Miniconda 是一个 Anaconda 的轻量级替代,默认只包含了 python 和 conda,但是可以通过 pip 和 conda 来安装所需要的包。
pip与conda的区别:

win7 安装prophet_第1张图片
conda中的包都是二进制包,不需要编译,而pip可以安装的包可以是源码包或者二进制包(whl文件),当使用pip安装源码包时,需要涉及一些c/c++的编译工作,而pip只能管理python包之间的依赖关系,所以可能会安装失败。

  1. 配置清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
  1. 配置conda第三方源
    有时想使用conda安装一些在pip中存在的包,但是可能conda提供的镜像源中没有,所有可以使用conda的第三方源,conda-forge就是其中一个。
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ # conda-forge是conda的第三方源
conda config --set show_channel_urls yes
  1. 配置公司代理
    在.condarc文件中添加如下内容:
proxy_servers:
  代理地址

(2)安装pystan

安装prophet需要先安装pystan,而在windows下安装pystan有些问题,pystan官方文档中建议的安装方式是直接使用conda进行安装,

(1) conda install libpython m2w64-toolchain -c msys2 # Installing C++ compiler, msys2也是conda的一个第三方库, -c参数指定从哪个conda第三方库进行安装
(2) conda install numpy cython matplotlib scipy pandas pystan -c conda-forge # Install dependencies
(3) conda install pystan -c conda-forge # 安装pystan

(3)安装prophet

pip install fbprophet

注:上面的(2),(3)是使用pip安装prophet的步骤,其实最简单是直接使用conda进行安装:

conda install fbprophet -c conda-forge # 这种方式可以自己安装pystan依赖

(4)常见错误

ERROR:fbprophet:Importing plotly failed. Interactive plots will not work.

解决办法:

conda install plotly

你可能感兴趣的:(笔记杂)