Facebook的开源时序分析库fbprophet号称史上最难安装的库,实测确实如此。
百度了各种简单粗暴或者详细的安装步骤,期间遭遇了各种各样奇怪的问题,现简录如下:
1.已经安装了pystan的前提下,用conda install -c conda-forge install fbprophet,
(base) C:\WINDOWS\system32>conda install -c conda-forge fbprophet
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
2.出现上述问题,我尝试了用管理员权限conda update --all, 等所有的包都更新完毕之后,再次conda install -c conda-forge install fbprophet , 读出另一个环境不匹配的问题,我的python版本是3.9,与fbprophet不兼容。
(base) C:\WINDOWS\system32>conda install -c conda-forge fbprophet
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- fbprophet -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']
Your python: python=3.9
3.在Anaconda中创建python3.7的虚拟环境:
conda create -n py37 python=3.7
4.激活并进入虚拟环境,然后再安装fbprophet:
(base) C:\WINDOWS\system32>activate py37
(py37) C:\WINDOWS\system32>conda install -c conda-forge fbprophet
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
(py37) C:\WINDOWS\system32>python
Python 3.7.11 (default, Jul 27 2021, 09:42:29) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import fbprophet
Importing plotly failed. Interactive plots will not work.
可以发现虚拟环境中确实可以正确安装fbprophet,但是导入该库时发掘提示Interactive plots will not work,于是又需要conda install plotly -y. 真是环环相扣,问题百出的一个库。
经过两天的搏杀,总算成功装好fbprophet。希望使用过程能稍微友好一点的。待续。