您当前的位置:首页 > 计算机 > 系统应用 > Windows

windows10下安装fbprophet

时间:03-08来源:作者:点击数:
背景:公司需要做数据分析,需要用到这个安装包,数据在Windows上,不在Linux中,所以需要调查一下Windows下安装,本以为分分钟搞定的事情,结果弄了整整一天,安装过程中反复安装Anaconda不下10次,看了相关的文章也看了许多,结果还是以失败告终,最后调查各个组件之间的依赖关系,逐个安装,搞定。
note(非常重要):这几个组件是有依赖关系的,安装fbprophet前提是依赖于pystan的而pystan是依赖于c++编译器的,Anaconda和python的版本也是有依赖关系的,我用的是Anaconda3和python3.7

下面详细的介绍一下安装步骤

第一步:安装Anaconda,并且配置环境变量

我的Anaconda的安装目录如下;

在这里插入图片描述

根据Anaconda的安装目录配置环境变量如下;

在这里插入图片描述
第二步:更新conda环境

然后点击电脑的左下角,选择Anaconda prompt,输入conda -V查看一下版本

在这里插入图片描述

然后输入更新命令:conda update -n base conda(这个命令如果没更新,可以进行第二次更新)

更新完成后再查一下conda版本:conda -V

然后最后执行一下conda update --all,这样conda的环境就非常干净了,very nice。

第三步:创建conda环境,并且激活环境

打开Anaconda propmt, 执行命令

conda create –n wzx  python=3.7
 (wzx的名字是自己起的,一会儿在配置pycharm的时候也会用到,这里指定用python3.7版本,其它的版本别建议尝试,非常消耗时间)

激活环境

执行命令:

conda activate wzx
第四步:安装C++编译器

执行命令:

conda install libpython m2w64-toolchain -c msys2

测试C++编译器

输入g++,若报不是内部或外部命令,也不是可运行的程序,则未安装上。若报fatal error: no input files则表示安装上

第五步:安装依赖包 numpy,cython,pandas,scipy,matplotlib
conda install numpy -c conda -f
 
    conda install cython -c conda -f
 
    conda install pandas -c conda -f
 
    conda install scipy -c conda -f
 
    conda install matplotlib -c conda -f

第六步:安装依赖包pystan

命令:pip install pystan 或者conda install pystan -c conda-forge (conda install pystan这个好像也成功了)

执行完安装命令后,运行一下conda list 看一下有没有pystan,有了再往下继续,不然你装不上fbprophet

(wzx) C:\Users\Administrator>conda list
# packages in environment at F:\soft\anaconda\envirment\envs\wzx:
#
# Name                    Version                   Build  Channel
arviz                     0.11.2             pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
asgiref                   3.3.4              pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
bzip2                     1.0.8                h8ffe710_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ca-certificates           2020.12.5            h5b45459_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
certifi                   2020.12.5        py37h03978a9_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cftime                    1.4.1            py37hda49f71_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
convertdate               2.3.2              pyhd8ed1ab_0    conda-forge
curl                      7.76.0               hf1763fc_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cycler                    0.10.0                     py_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
cython                    0.29.22          py37hf2a7229_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
django                    3.2                pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ephem                     3.7.7.1          py37h4ab8f01_1    conda-forge
fbprophet                 0.7.1            py37h1834ac0_0    conda-forge
freetype                  2.10.4               h546665d_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
hdf4                      4.2.13            h0e5069d_1004    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
hdf5                      1.10.6          nompi_h5268f04_1114    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
hijri-converter           2.1.1              pyhd8ed1ab_0    conda-forge
holidays                  0.11.1             pyhd8ed1ab_0    conda-forge
icu                       68.1                 h0e60522_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
intel-openmp              2021.2.0           h57928b3_616    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
jpeg                      9d                   h8ffe710_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
kiwisolver                1.3.1            py37h8c56517_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
korean_lunar_calendar     0.2.1              pyh9f0ad1d_0    conda-forge
krb5                      1.17.2               hbae68bd_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
lcms2                     2.12                 h2a16943_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libblas                   3.9.0                     8_mkl    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libcblas                  3.9.0                     8_mkl    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libclang                  11.1.0          default_h5c34c98_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libcurl                   7.76.0               hf1763fc_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
liblapack                 3.9.0                     8_mkl    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libnetcdf                 4.8.0           nompi_h3510683_100    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libpng                    1.6.37               h1d00b33_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libpython                 2.0              py37h03978a9_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libssh2                   1.9.0                h680486a_6    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libtiff                   4.2.0                hc10be44_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
lunarcalendar             0.0.9                      py_0    conda-forge
lz4-c                     1.9.3                h8ffe710_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
m2w64-binutils            2.25.1                        5    msys2
m2w64-bzip2               1.0.6                         6    msys2
m2w64-crt-git             5.0.0.4636.2595836               2    msys2
m2w64-gcc                 5.3.0                         6    msys2
m2w64-gcc-ada             5.3.0                         6    msys2
m2w64-gcc-fortran         5.3.0                         6    msys2
m2w64-gcc-libgfortran     5.3.0                         6    msys2
m2w64-gcc-libs            5.3.0                         7    msys2
m2w64-gcc-libs-core       5.3.0                         7    msys2
m2w64-gcc-objc            5.3.0                         6    msys2
m2w64-gmp                 6.1.0                         2    msys2
m2w64-headers-git         5.0.0.4636.c0ad18a               2    msys2
m2w64-isl                 0.16.1                        2    msys2
m2w64-libiconv            1.14                          6    msys2
m2w64-libmangle-git       5.0.0.4509.2e5a9a2               2    msys2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2    msys2
m2w64-make                4.1.2351.a80a8b8               2    msys2
m2w64-mpc                 1.0.3                         3    msys2
m2w64-mpfr                3.1.4                         4    msys2
m2w64-pkg-config          0.29.1                        2    msys2
m2w64-toolchain           5.3.0                         7    msys2
m2w64-toolchain_win-64    2.4.0                         0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
m2w64-tools-git           5.0.0.4592.90b8472               2    msys2
m2w64-windows-default-manifest 6.4                           3    msys2
m2w64-winpthreads-git     5.0.0.4634.697f757               2    msys2
m2w64-zlib                1.2.8                        10    msys2
matplotlib                3.4.1            py37h03978a9_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
matplotlib-base           3.4.1            py37h0d1fb12_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
mkl                       2020.4             hb70f87d_311    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
msys2-conda-epoch         20160418                      1    msys2
netcdf4                   1.5.6           nompi_py37h5c66228_101    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
numpy                     1.20.2           py37hcbcd69c_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
olefile                   0.46               pyh9f0ad1d_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openjpeg                  2.4.0                h48faf41_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openssl                   1.1.1k               h8ffe710_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
packaging                 20.9               pyh44b312d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pandas                    1.2.3            py37h08fd248_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pillow                    8.1.2            py37h96663a1_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pip                       21.0.1             pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
plotly                    4.14.3             pyh44b312d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pymeeus                   0.5.10             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyqt                      5.12.3           py37h03978a9_7    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyqt-impl                 5.12.3           py37hf2a7229_7    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyqt5-sip                 4.19.18          py37hf2a7229_7    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyqtchart                 5.12             py37hf2a7229_7    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pyqtwebengine             5.12.1           py37hf2a7229_7    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pystan                    2.19.1.1         py37h9758500_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python                    3.7.10          h7840368_100_cpython    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python-dateutil           2.8.1                      py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python_abi                3.7                     1_cp37m    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pytz                      2021.1             pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
qt                        5.12.9               h5909a2a_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
retrying                  1.3.3                      py_2    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
scipy                     1.6.2            py37h924764e_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
setuptools                49.6.0           py37h03978a9_3    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
six                       1.15.0             pyh9f0ad1d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
sqlite                    3.35.4               h8ffe710_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
sqlparse                  0.4.1              pyh9f0ad1d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
tk                        8.6.10               h8ffe710_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
tornado                   6.1              py37hcc03f2d_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
tqdm                      4.60.0             pyhd8ed1ab_0    conda-forge
typing_extensions         3.7.4.3                    py_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vc                        14.2                 hb210afc_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
vs2015_runtime            14.28.29325          h5e1d092_4    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wheel                     0.36.2             pyhd3deb0d_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
wincertstore              0.2             py37h03978a9_1006    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
xarray                    0.17.0             pyhd8ed1ab_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
xz                        5.2.5                h62dcd97_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
zlib                      1.2.11            h62dcd97_1010    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
zstd                      1.4.9                h6255e5f_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

(wzx) C:\Users\Administrator>
第七步:安装fbprophet
conda install -c conda-forge fbprophet 
 
conda install fbprophet -c conda -f 

如果上面的安装命令没有成功 可以试试 conda install fbprophet

第八步:测试是否安装成功

还是在Anaconda propmt下输入python,然后再输入

from fbprophet import Prophet

如下图所示,则安装成功

在这里插入图片描述

你以为这就完成了,NO、NO、NO,接下来要在pycharm中集成上面在conda中创建的环境,这里又花费了我1个小时,不太懂python和Anaconda、conda这几个环境之间的关系

第九步:在pycharm中集成conda中你自己创建的环境

点击file–>Default settings–>选择你在conda中创建的环境

wzx这就是刚才我在conda中创建的环境

在这里插入图片描述
最后一步:测试在pycharm中怎么导入

在这里插入图片描述遇到的一个问题记录:

在python里导入模块 from fbprophet import Prophet时出现
ERROR:fbprophet:Importing plotly failed. Interactive plots will not work.

解决方法:conda install plotly -y

同事安装的时候,发现还是不行,但是conda list 发现有plotly 包,这个时候只需要升级plotly 这个包就搞定了

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门