Scikit learn 无法在scikit学习0.16中导入最近邻居

Scikit learn 无法在scikit学习0.16中导入最近邻居,scikit-learn,nearest-neighbor,Scikit Learn,Nearest Neighbor,Python 3.4.3 v3.4.3:9b73f1c3e601,2015年2月23日,02:52:03 [GCC 4.2.1苹果公司在达尔文建造5666.3] 有关详细信息,请键入帮助、版权、信用证或许可证 import sklearn sklearn.__version__ '0.16.1' from sklearn.neighbors import NearestNeighbors Traceback (most recent call last): File "<stdin&

Python 3.4.3 v3.4.3:9b73f1c3e601,2015年2月23日,02:52:03 [GCC 4.2.1苹果公司在达尔文建造5666.3] 有关详细信息,请键入帮助、版权、信用证或许可证

import sklearn
sklearn.__version__
'0.16.1'
from sklearn.neighbors import NearestNeighbors

Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/neighbors/__init__.py", line 9, in <module>
    from .graph import kneighbors_graph, radius_neighbors_graph   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/neighbors/graph.py", line 9, in <module>
    from .base import KNeighborsMixin, RadiusNeighborsMixin   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/neighbors/base.py", line 18, in <module>
    from ..metrics import pairwise_distances   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/metrics/__init__.py", line 15, in <module>
    from .classification import accuracy_score   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/metrics/classification.py", line 31, in <module>
    from ..preprocessing import LabelBinarizer, label_binarize   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/sklearn/preprocessing/__init__.py", line 25, in <module>
    from ._weights import balance_weights ImportError: cannot import name 'balance_weights'

看起来你的sklearn是半身像。你能重新安装吗?我会试试看。我将sklearn 0.14与python2.7一起使用,没有问题。您是如何安装的?我再次安装了0.16,现在一切正常。谢谢