2

I'm currently trying to fit an ARMA model to some data, using the statsmodels module in Python. The problem is, however, that it fails to load the package, and just returns an AttributeError which states:

  File "C:\Projects\Python\KalmanFilteringDataFusion\armaTest.py", line 5, in <module>
    from statsmodels.tsa.arima_model import ARIMA
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\statsmodels\tsa\arima_model.py", line 30, in <module>
    from statsmodels.tsa.ar_model import AR
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\statsmodels\tsa\ar_model.py", line 608, in <module>
    class ARResults(tsbase.TimeSeriesModelResults):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\statsmodels\tsa\ar_model.py", line 811, in ARResults
    preddoc = AR.predict.__doc__.split('\n')
AttributeError: 'NoneType' object has no attribute 'split'

The only thing i'm doing, is trying to import the ARIMA module as:

from statsmodels.tsa.arima_model import ARIMA

If i try to import another statmodels sub-module (ex. import statsmodels.formula.api as smf) it returns:

  File "C:\Projects\Python\KalmanFilteringDataFusion\armaTest.py", line 5, in <module>
    import statsmodels.formula.api as smf
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\statsmodels\formula\api.py", line 15, in <module>
    from statsmodels.discrete.discrete_model import MNLogit
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\statsmodels\discrete\discrete_model.py", line 146, in <module>
    class DiscreteModel(base.LikelihoodModel):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\statsmodels\discrete\discrete_model.py", line 208, in DiscreteModel
    fit.__doc__ += base.LikelihoodModel.fit.__doc__
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'NoneType'

If i just do import statsmodels or import statsmodels.tsa it imports it just fine, so i guess that the error lies somewhere in the ARIMA "sub-module".

Does anybody have any suggestions as to what is wrong? And any potential fix to it?

8
  • How did you install statsmodels, and which version is it? Commented Apr 5, 2018 at 11:36
  • Using pip, through Visual Studio. That might be the issue. The version is 0.8.0. Commented Apr 5, 2018 at 11:41
  • I tried to uninstall Python completely, and re-install it (not through VS), and it returns the same error. Python version 3.6.5 Commented Apr 5, 2018 at 12:28
  • Does your pip installation succeed? I only see the source package for Win. I just installed for Python35 x64 and it works. Commented Apr 5, 2018 at 13:18
  • 1
    I guess this is github.com/statsmodels/statsmodels/issues/4242 Commented Apr 5, 2018 at 14:29

1 Answer 1

1

I was using Sublime Text 3 to compile Python, and apparantly the "Python3" build file, was causing the error. When i switched to the "Python"-builder, the system compiled just fine. Except for a few warning about pandas dropping support for the way DateTime is implemented in statsmodels.

If you're stuck in the same situation, try switching builder. I'll keep you posted when i figure out why that was the case. Cause it was really weird.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.