Devinity
Devinity

Reputation: 377

Statsmodels.api doesn't import

That's it. It installs, I can import statsmodels, but statsmodels.api doesn't import. I've tried installing with pip and conda, both give me version 0.9.0 and everything is fine. I've installed all the dependencies, statsmodels works, but statsmodels.api doesn't.

import statsmodels.api Traceback (most recent call last): File "", line 1, in File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\statsmodels\api.py", line 16, in from .discrete.discrete_model import (Poisson, Logit, Probit, File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\statsmodels\discrete\discrete_model.py", line 45, in from statsmodels.distributions import genpoisson_p File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\statsmodels\distributions__init__.py", line 2, in from .edgeworth import ExpandedNormal File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\statsmodels\distributions\edgeworth.py", line 7, in from scipy.misc import factorial ImportError: cannot import name 'factorial' from 'scipy.misc' (C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\scipy\misc__init__.py)

Upvotes: 1

Views: 272

Answers (1)

VicTee646
VicTee646

Reputation: 26

From the error it looks as though there is not a function called factorial within the misc directory of the scipy package.

Have you tried opening up the __init__.py file specified in the error and looking through the misc directory to find the factorial function?

Upvotes: 1

Related Questions