Python 3:在尝试导入pyramid.arima时,接收到“ AttributeError:模块'statsmodels'没有属性'tsa'`。

时间:2018-12-27 02:58:04

标签: python python-3.x statsmodels pyramid-arima

标题说明了一切。最近使用pyramid-arima通过Anaconda提示安装的pip install pyramid-arima软件包。然后,我转到python代码并尝试通过调用from pyramid.arima import auto_arima来导入它,但随后收到一条错误消息,提示AttributeError: module 'statsmodels' has no attribute 'tsa'

我试图通过pip命令卸载并重新安装statsmodels库来解决该错误,但仍收到相同的错误。但是,当我运行import statsmodels时,不会出现任何错误。完整的错误是:

`from pyramid.arima import auto_arima Traceback (most recent call last):

  File "<ipython-input-57-4e35d3e40b01>", line 1, in <module>
    from pyramid.arima import auto_arima

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\pyramid\__init__.py", line 29, in <module>
    from .arima import auto_arima, ARIMA

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\pyramid\arima\__init__.py", line 5, in <module>
    from .approx import *

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\pyramid\arima\approx.py", line 12, in <module>
    from ..utils import get_callable

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\pyramid\utils\__init__.py", line 8, in <module>
    from .visualization import *

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\pyramid\utils\visualization.py", line 12, in <module>
    from statsmodels.graphics.tsaplots import plot_acf as pacf, plot_pacf as ppacf

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\statsmodels\graphics\tsaplots.py", line 8, in <module>
    from statsmodels.tsa.stattools import acf, pacf

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\statsmodels\tsa\stattools.py", line 17, in <module>
    from statsmodels.tsa.arima_model import ARMA

  File "C:\Users\Michael.Hult\AppData\Local\Continuum\anaconda3\lib\site-packages\statsmodels\tsa\arima_model.py", line 22, in <module>
    import statsmodels.tsa.base.tsa_model as tsbase

AttributeError: module 'statsmodels' has no attribute 'tsa' `

版本如下: Python 3.6.5 统计模型0.9.0 金字塔区域0.9.0 pmdarima 1.0.0

0 个答案:

没有答案