2017-08-07 23 views
1

私はpythonに初心者としては初めてのためのいくつかの輸入とRodeoを設定しています:statsmodelsの_representationと_kalman_filterを実装しているPythonパッケージはどれですか?

import sys 
import pandas as pd 
import pylab as pl 
import numpy as np 
import statsmodels.api as sm 

しかしimport statsmodelsはエラーを与え続けています。最新のものは次のとおりです。

>>> import statsmodels.api as sm 
ImportError: cannot import name '_representation' 
--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
<ipython-input-2-6030a6549dc0> in <module>() 
----> 1 import statsmodels.api as sm 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\api.py in <module>() 
     5 from . import regression 
     6 from .regression.linear_model import OLS, GLS, WLS, GLSAR 
----> 7 from .regression.recursive_ls import RecursiveLS 
     8 from .regression.quantile_regression import QuantReg 
     9 from .regression.mixed_linear_model import MixedLM 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\regression\recursive_ls.py in <module>() 
    14 from statsmodels.regression.linear_model import OLS 
    15 from statsmodels.tools.data import _is_using_pandas 
---> 16 from statsmodels.tsa.statespace.mlemodel import (
    17  MLEModel, MLEResults, MLEResultsWrapper) 
    18 from statsmodels.tools.tools import Bunch 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\tsa\statespace\mlemodel.py in <module>() 
    13 from scipy.stats import norm 
    14 
---> 15 from .simulation_smoother import SimulationSmoother 
    16 from .kalman_smoother import SmootherResults 
    17 from .kalman_filter import (INVERT_UNIVARIATE, SOLVE_LU) 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\tsa\statespace\simulation_smoother.py in <module>() 
     8 
     9 import numpy as np 
---> 10 from .kalman_smoother import KalmanSmoother 
    11 from . import tools 
    12 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\tsa\statespace\kalman_smoother.py in <module>() 
     9 import numpy as np 
    10 
---> 11 from statsmodels.tsa.statespace.representation import OptionWrapper 
    12 from statsmodels.tsa.statespace.kalman_filter import (KalmanFilter, 
    13              FilterResults) 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\tsa\statespace\representation.py in <module>() 
     8 
     9 import numpy as np 
---> 10 from .tools import (
    11  find_best_blas_type, validate_matrix_shape, validate_vector_shape 
    12) 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\tsa\statespace\tools.py in <module>() 
    205    'z': _statespace.zcopy_index_vector 
    206   }) 
--> 207 set_mode(compatibility=None) 
    208 
    209 
c:\python36\lib\site-packages\statsmodels-0.8.0-py3.6-win-amd64.egg\statsmodels\tsa\statespace\tools.py in set_mode(compatibility) 
    57  if not compatibility: 
    58   from scipy.linalg import cython_blas 
---> 59   from . import (_representation, _kalman_filter, _kalman_smoother, 
    60      _simulation_smoother, _tools) 
    61   compatibility_mode = False 
ImportError: cannot import name '_representation' 

私はこのエラーを理解しているかどうかわかりません。どのパッケージRodeoがここにありますか? cython_blasでそれが欠けていますか?

+1

私の推測ではstatespaceでcython/Cの拡張機能が全くないか互換性のある方法で、正しく構築されていないということでしょう。 – user333700

+0

こんにちは、Cの拡張機能を再構築する方法についてのガイダンスはありますか? cython/Cエクステンションの再構築のためのオンライン検索結果はあまりありません。 BTWのcythonは最新です。 – user938363

+0

cythonをアンインストールして、cython 0.26を再インストールしてください。それは助けになりませんでした。同じエラー。 – user938363

答えて

1

依存関係の互換性のないまたは古いバージョンがあります。

して依存関係を更新してみて、それが助けかどうかを確認:

pip install statsmodels --upgrade 
+0

投稿する前に、私はWindowsターミナルでまったく同じコマンドを実行し、全ての 'requirements up-to-date'を受け取りました。 – user938363

関連する問題