安装scikit neuralnetwork后SVM导入失败



我刚刚使用上述过程安装了Python的scikit neuralnetwork,即;

pip install scikit-neuralnetwork

现在我无法导入SVM。这条线;

from sklearn import svm

给出该错误;

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//anaconda/lib/python2.7/site-packages/sklearn/svm/__init__.py", line 13, in <module>
    from .classes import SVC, NuSVC, SVR, NuSVR, OneClassSVM, LinearSVC, 
  File "//anaconda/lib/python2.7/site-packages/sklearn/svm/classes.py", line 4, in <module>
    from .base import _fit_liblinear, BaseSVC, BaseLibSVM
  File "//anaconda/lib/python2.7/site-packages/sklearn/svm/base.py", line 12, in <module>
    from ..multiclass import _ovr_decision_function
  File "//anaconda/lib/python2.7/site-packages/sklearn/multiclass.py", line 44, in <module>
    from .metrics.pairwise import euclidean_distances
  File "//anaconda/lib/python2.7/site-packages/sklearn/metrics/__init__.py", line 33, in <module>
    from . import cluster
  File "//anaconda/lib/python2.7/site-packages/sklearn/metrics/cluster/__init__.py", line 21, in <module>
    from .bicluster import consensus_score
  File "//anaconda/lib/python2.7/site-packages/sklearn/metrics/cluster/bicluster/__init__.py", line 1, in <module>
    from .bicluster_metrics import consensus_score
  File "//anaconda/lib/python2.7/site-packages/sklearn/metrics/cluster/bicluster/bicluster_metrics.py", line 6, in <module>
    from sklearn.utils.validation import check_arrays
ImportError: cannot import name check_arrays

我可以知道出了什么问题吗?如果有帮助的话,我下次会尝试使用不同的环境。有什么办法解决这个问题吗?

我使用的是Python 2.7和sklearn 0.17。

打开sklearn.utils.validation并删除"import check_arrays",或者使用其他包,例如anaconda3。我现在检查一下,没有问题。或者安装anaconda3.5并将check_array复制到anaconda2.7 sklearn.utils.validation.

相关内容

  • 没有找到相关文章

最新更新