Totally new to Python. Saw no hits whatsoever on this error. Here's what I did, almost to the keystroke:
- Clean install of Python 3.6.
- pip install -U statsmodels
- pip install scipy
- pip install numpy
- pip install statsmodels --upgrade
- (In Python): import statsmodels.api as sm -> "AttributeError: module 'statsmodels' has no attribute 'compat'"
Any suggestions? I'm just trying to walk through a multi regression tutorial on https://towardsdatascience.com/simple-and-multiple-linear-regression-in-python-c928425168f9. Full traceback follows.
Thanks in advance.
>>> import statsmodels.api as sm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\dataylor\AppData\Local\Programs\Python\Python36-32\lib\site-packages\statsmodels\api.py", line 35, in <module>
from .stats import api as stats
File "C:\Users\dataylor\AppData\Local\Programs\Python\Python36-32\lib\site-packages\statsmodels\stats\api.py", line 65, in <module>
from .mediation import Mediation
File "C:\Users\dataylor\AppData\Local\Programs\Python\Python36-32\lib\site-packages\statsmodels\stats\mediation.py", line 22, in <module>
import statsmodels.compat.pandas as pdc # pragma: no cover
AttributeError: module 'statsmodels' has no attribute 'compat'
statsmodels
is properly installed. It may be worth uninstalling it withpip uninstall statsmodels
and then installing again withpip install statsmodels
– Will Keeling