Bro*_*Bal 1 python facebook-prophet
我正在尝试使用 Python 3.10.10 在 MacOS 10.15.5 上安装 FBProphet 模块。通过 pip 成功安装软件包后,我尝试导入模块 ( from prophet import Prophet
),但收到以下错误消息:
TypeError Traceback (most recent call last)
Cell In[4], line 2
1 #Trying the FP Prophet model on the data
----> 2 from prophet import Prophet
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prophet/__init__.py:7
1 # Copyright (c) 2017-present, Facebook, Inc.
2 # All rights reserved.
3 #
4 # This source code is licensed under the BSD-style license found in the
5 # LICENSE file in the root directory of this source tree. An additional grant
6 # of patent rights can be found in the PATENTS file in the same directory.
----> 7 from prophet.forecaster import Prophet
9 from pathlib import Path
10 about = {}
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prophet/forecaster.py:19
16 import pandas as pd
17 from numpy.typing import NDArray
---> 19 from prophet.make_holidays import get_holiday_names, make_holidays_df
20 from prophet.models import StanBackendEnum
21 from prophet.plot import (plot, plot_components)
File /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/prophet/make_holidays.py:14
...
175 self.entity_name = entity_path[-1]
176 self.module_name = ".".join(entity_path[0:-1])
--> 178 super().__init__(*args, **kwargs)
TypeError: object.__init__() takes exactly one argument (the instance to initialize)```
Does anyone understand why this happens and how to fix this?
Run Code Online (Sandbox Code Playgroud)
我从一个中文网站找到了解决方案:
pip install holidays==0.24
Run Code Online (Sandbox Code Playgroud)
0.25版本使错误追加。
测试环境:ubuntu 22.04、python 3.10.4、pip 23.1.2、prophet 1.1.2
开放问题: https: //github.com/facebook/prophet/issues/2432