ImportError: cannot import name choice when importing sklearn.mixture

后端 未结 3 830
慢半拍i
慢半拍i 2021-01-17 23:43

I am using scikit learn 0.15.0. When I try to import sklearn.mixture I get ImportError: cannot import name choice

Any ideas?

================================

3条回答
  •  独厮守ぢ
    2021-01-17 23:56

    I was getting the same error when I tried to import KMeans as : from sklearn.cluster import KMeans

    Error > ImportError: cannot import name choice

    I found the answer here: https://github.com/scikit-learn/scikit-learn/issues/3461

    Since I have upgraded to Scikit version 0.15 a few days back, the older version of random.so was present in /usr/local/lib/python2.7/dist-packages/sklearn/utils.

    I manually deleted it and now I do not get the error anymore.

    Hope this helps.

提交回复
热议问题