简体   繁体   中英

Unexpected error from import statsmodels.api as sm

I've been using statsmodels for a long time now - always importing it using

import statsmodels.api as sm

But today, seemingly out of the blue, this error is raised:

AttributeError: module 'statsmodels' has no attribute 'api'

Of course sm.version.version raises an error too, but

import statsmodels
statsmodels.__version__

returns '0.6.1'

I've tried reinstalling following the docs

But entering the command pip install -U statsmodels only returns:

在此处输入图片说明

Does anyone know what could be causing this?

I'm Windows 7 running Python 3.6.0

sys.version:

3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)]

I'm using Anaconda, so why am I messing around with pip in this case? The truth is that I really don't know.

This sorted out the issue:

conda install statsmodels

By the way, I think the reason why I messed things up was because I tried to install an arima package a few days ago.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM