简体   繁体   中英

ImportError: No module named statsmodels.api

I'm new in python and have this problem. I have install Pandas, Numpy, Scipy, and I install Stats Models with apt-get install python-statsmodels, but when I try to use:

import statsmodels.api as sm

But I have this problem:

ImportError                               Traceback (most recent call last)
<ipython-input-1-6030a6549dc0> in <module>()
----> 1 import statsmodels.api as sm

ImportError: No module named statsmodels.api

Why??

On Ubuntu 12.04, statsmodels is installed through scikits.

Hence:

import scikits.statsmodels.api as sm
from statsmodels import api as sm

我也有同样的错误,需要安装以下内容 statsmodels - 与 scipy 一起使用的统计计算模型。

It requires Stats module to be istalled...

Python command# !pip3 install statsmodels

Reference# https://pypi.org/project/statsmodels/

For the current version you could use a binary installer:

http://statsmodels.sourceforge.net/binaries/

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