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

安装Python的fbprophet库时提示‘name HolidayBase is not defined’该如何解决?

NameError: 'HolidayBase' is not defined when installing fbprophet

I recently banged my head against this exact error while trying to get fbprophet set up in Python—spent way too long troubleshooting before finding a fix. Since I know how annoying this can be, I wanted to share what worked for me to save others the hassle.

Here's how I fixed it:

  • Uninstall conflicting packages first
    Start by removing any existing installs of fbprophet, prophet, and pystan to clear out version conflicts:

    pip uninstall -y fbprophet prophet pystan
    
  • Install the last stable fbprophet version
    Fbprophet has been deprecated and replaced with the prophet package, and newer versions have changed the structure around HolidayBase. The last version of fbprophet that uses the original HolidayBase naming is 0.7.1:

    pip install fbprophet==0.7.1
    
  • Pin pystan to a compatible version
    To avoid further compatibility issues, make sure you're using a pystan version that works with fbprophet 0.7.1. Pystan 2.19.1.1 is a safe bet:

    pip install pystan==2.19.1.1
    

Why this happens:

The main issue is that the newer prophet package (which replaced fbprophet) either renamed or moved the HolidayBase class. If you end up mixing old fbprophet installs with newer prophet packages, or try to install an unmaintained newer fbprophet build, Python can't find the HolidayBase class it expects, throwing that NameError.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.06 17:12:47