You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mac环境下安装fbprophet报错,conda安装卡在pystan步骤

解决Mac上conda安装fbprophet时的编译错误

错误根源

你遇到的TypeError是由于python-holidays版本过高导致的兼容性问题:新版python-holidays重构了Entity类的导入逻辑,但旧版fbprophet仍使用老的导入路径,从而触发编译失败。

解决方案

方法1:固定python-holidays兼容版本

先安装适配fbprophet的python-holidays旧版本,再安装fbprophet:

# 先安装指定版本的python-holidays
pip install python-holidays==0.10.5.2

# 再用conda安装fbprophet
conda install -c conda-forge fbprophet

如果用pip直接安装fbprophet:

pip install python-holidays==0.10.5.2 fbprophet

方法2:安装修复兼容性的fbprophet开发版

如果想使用较新的依赖环境,可以安装fbprophet的main分支(已修复该导入问题):

pip install git+https://github.com/facebook/prophet.git@main

方法3:确保pystan版本兼容

fbprophet旧版本仅支持pystan 2.x系列,若之前安装了pystan 3.x,需先降级:

pip install pystan==2.19.1.1

验证安装

打开Python终端,执行以下代码验证:

from fbprophet import Prophet

无报错则说明安装成功。

内容的提问来源于stack exchange,提问作者JavaMan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 15:37:35