首页 > 解决方案 > Jupyter Notebook 中 fbprophet 的构建轮子失败

问题描述

我正在尝试使用在 Jupyter Notebook 中安装 fbprophet !pip install fbprophet

我已经有 pystan 和 Microsoft Visual Studio

以下是我得到的错误

fbprophet 命令的构建轮失败“C:\Users\evaldovi\Anaconda3\python.exe -u -c”import setuptools, tokenize; file ='C:\Users\evaldovi\AppData\Local\Temp\pip-install-e2tuxpri\fbprophet\setup.py';f=getattr(tokenize, 'open', open)( file );code=f.read ().replace('\r\n', '\n');f.close();exec(compile(code, file , 'exec'))" install --record C:\Users\evaldovi\AppData \Local\Temp\pip-record-yijav0j4\install-record.txt --single-version-externally-managed --compile" 在 C:\Users\evaldovi\AppData\Local\Temp\pip- 中出现错误代码 1 失败安装-e2tuxpri\fbprophet\

标签: pythonpipjupyter-notebook

解决方案


Usually the source of this issue is that PyStan is not working due to the C++ compiler not working properly.
You can check if PyStan is working with

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

Anaconda 的安装稍微复杂一些,因为它有一个独立于系统 python 的构建环境。在 Anaconda 中安装 fbprophet 的最简单方法是通过 conda forge:

conda install gcc
conda install -c conda-forge fbprophet

推荐阅读