简体   繁体   中英

SVM import failed after installing scikit-neuralnetwork

I just installed Python's scikit-neuralnetwork using the procedure mentioned, that is;

pip install scikit-neuralnetwork

Now I can not import SVM. This line;

from sklearn import svm

gives this error;

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

May I know what went wrong? I'll try using different environments next time, if that helps. Is there any way to fix this?

I am using Python 2.7 and sklearn 0.17.

open sklearn.utils.validation and delete "import check_arrays", or use other package for example anaconda3. i check now - no problems. Or install anaconda3.5 and copy check_arrays to anaconda2.7 sklearn.utils.validation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM