我正在嘗試導入sklearn.model_selection
。我試圖重新安裝scikit-learn和anaconda,但仍然無法正常工作。 以下是錯誤味精我:無法在scikit-learn中導入sklearn.model_selection
ImportError Traceback (most recent call last)
<ipython-input-69-e49df3a70ea4> in <module>()
4 get_ipython().magic(u'matplotlib inline')
5 # from sklearn.model_selection import train_test_split
----> 6 import sklearn.model_selection
/Users/Lu/anaconda/lib/python2.7/site-packages/sklearn/model_selection/__init__.py in <module>()
----> 1 from ._split import BaseCrossValidator
2 from ._split import KFold
3 from ._split import GroupKFold
4 from ._split import StratifiedKFold
5 from ._split import TimeSeriesSplit
/Users/Lu/anaconda/lib/python2.7/site-packages/sklearn/model_selection/_split.py in <module>()
34 from ..utils.random import choice
35 from ..base import _pprint
---> 36 from ..gaussian_process.kernels import Kernel as GPKernel
37
38 __all__ = ['BaseCrossValidator',
/Users/Lu/anaconda/lib/python2.7/site-packages/sklearn/gaussian_process/__init__.py in <module>()
11 """
12
---> 13 from .gpr import GaussianProcessRegressor
14 from .gpc import GaussianProcessClassifier
15 from . import kernels
/Users/Lu/anaconda/lib/python2.7/site-packages/sklearn/gaussian_process/gpr.py in <module>()
10 import numpy as np
11 from scipy.linalg import cholesky, cho_solve, solve_triangular
---> 12 from scipy.optimize import fmin_l_bfgs_b
13
14 from sklearn.base import BaseEstimator, RegressorMixin, clone
/Users/Lu/anaconda/lib/python2.7/site-packages/scipy/optimize/__init__.py in <module>()
232 from .optimize import *
233 from ._minimize import *
--> 234 from ._root import *
235 from .minpack import *
236 from .zeros import *
/Users/Lu/anaconda/lib/python2.7/site-packages/scipy/optimize/_root.py in <module>()
17
18 from .optimize import MemoizeJac, OptimizeResult, _check_unknown_options
---> 19 from .minpack import _root_hybr, leastsq
20 from ._spectral import _root_df_sane
21 from . import nonlin
/Users/Lu/anaconda/lib/python2.7/site-packages/scipy/optimize/minpack.py in <module>()
2
3 import warnings
----> 4 from . import _minpack
5
6 import numpy as np
ImportError: cannot import name _minpack
你以爲更新'scipy'?你是如何重新安裝sklearn的?與'conda'? – MMF