我正在尝试使用statsmodels&amp ;;进行逻辑回归。无法导入。我在Jupyter笔记本中使用statsmodels v0.8.0
和Python 3.x.我怎么能正确导入?
ImportError Traceback (most recent call last)
<ipython-input-47-6030a6549dc0> in <module>()
----> 1 import statsmodels.api as sm
/Applications/anaconda/lib/python3.6/site-packages/statsmodels/api.py in <module>()
3 from . import tools
4 from .tools.tools import add_constant, categorical
----> 5 from . import regression
6 from .regression.linear_model import OLS, GLS, WLS, GLSAR
7 from .regression.recursive_ls import RecursiveLS
/Applications/anaconda/lib/python3.6/site-packages/statsmodels/regression/__init__.py in <module>()
----> 1 from .linear_model import yule_walker
2
3 from statsmodels import NoseWrapper as Tester
4 test = Tester().test
/Applications/anaconda/lib/python3.6/site-packages/statsmodels/regression/linear_model.py in <module>()
51 cache_readonly,
52 cache_writable)
---> 53 import statsmodels.base.model as base
54 import statsmodels.base.wrapper as wrap
55 from statsmodels.emplike.elregress import _ELRegOpts
/Applications/anaconda/lib/python3.6/site-packages/statsmodels/base/model.py in <module>()
8 from statsmodels.stats.contrast import ContrastResults, WaldTestResults
9 from statsmodels.tools.decorators import resettable_cache, cache_readonly
---> 10 import statsmodels.base.wrapper as wrap
11 from statsmodels.tools.numdiff import approx_fprime
12 from statsmodels.tools.sm_exceptions import ValueWarning, \
/Applications/anaconda/lib/python3.6/site-packages/statsmodels/base/wrapper.py in <module>()
3
4 import numpy as np
----> 5 from statsmodels.compat.python import get_function_name, iteritems, getargspec
6
7 class ResultsWrapper(object):
ImportError: cannot import name 'getargspec'