我正在尝试导入以下内容,并且出现importError:
import statsmodels.api as sm
cannot import name 'factorial' from 'scipy.misc'
从我的研究中,看起来像“阶乘”已从scipy.misc移到scipy.special。我从另一篇文章中读到了这篇文章,但是我所有的图书馆都是最新的。
ImportError Traceback (most recent call last)
<ipython-input-7-085740203b77> in <module>
----> 1 import statsmodels.api as sm
~\Anaconda3\lib\site-packages\statsmodels\api.py in <module>
14 from . import robust
15 from .robust.robust_linear_model import RLM
---> 16 from .discrete.discrete_model import (Poisson, Logit, Probit,
17 MNLogit, NegativeBinomial,
18 GeneralizedPoisson,
~\Anaconda3\lib\site-packages\statsmodels\discrete\discrete_model.py in <module>
43
44 from statsmodels.base.l1_slsqp import fit_l1_slsqp
---> 45 from statsmodels.distributions import genpoisson_p
46
47 try:
~\Anaconda3\lib\site-packages\statsmodels\distributions\__init__.py in <module>
1 from .empirical_distribution import ECDF, monotone_fn_inverter, StepFunction
----> 2 from .edgeworth import ExpandedNormal
3 from .discrete import genpoisson_p, zipoisson, zigenpoisson, zinegbin
~\Anaconda3\lib\site-packages\statsmodels\distributions\edgeworth.py in <module>
5 import numpy as np
6 from numpy.polynomial.hermite_e import HermiteE
----> 7 from scipy.misc import factorial
8 from scipy.stats import rv_continuous
9 import scipy.special as special
在第9行,它以特殊的方式导入scipy.special,因此从我读过的帖子中我应该能够无错误地导入它...我不确定这里是什么问题。