简体   繁体   中英

cannot import name 'BisectingKMeans' from 'sklearn.cluster' (C:\Users\Administrator\anaconda3\lib\site-packages\sklearn\cluster\__init__.py)

When I try to use sklearn.cluster.BisectingKMeans in my jupyter notebook, an ImportError occured. It is said in the document that this method is new in version 1.1, and my scikit-learn version is 1.1.3 . I was using the base environment so it's not an issue of lacking package in current environment. enter image description here

I've tried upgrade the scikit-learn package, but it doesn't help. Can anyone give me a hint of what is going on here? Thanks a lot!

This works on my machine:

from sklearn.cluster import BisectingKMeans

Also:

import sklearn
sklearn.__version__
> 1.1.2

Maybe you have a typo?

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.

Related Question cannot import name '_ClassNamePrefixFeaturesOutMixin' from 'sklearn.base' (C:\Users\yunhu\anaconda3\lib\site-packages\sklearn\base.py) ImportError: cannot import name 'TwitterRestPager' from 'TwitterAPI' (C:\Users\My name \Anaconda3\lib\site-packages\TwitterAPI\__init__.py) ImportError: cannot import name 'set_random_seed' from 'tensorflow' (C:\Users\polon\Anaconda3\lib\site-packages\tensorflow\__init__.py) ImportError: cannot import name 'logsumexp' from 'scipy.misc' (C:\Users\firstname.lastname\Anaconda3\lib\site-packages\scipy\misc\__init__.py) ImportError: cannot import name '_message' from 'google.protobuf.pyext' (c:\programdata\anaconda3\lib\site-packages\google\protobuf\pyext\__init__.py) EdgeIQ Error - Pytransform Error: Marshal loads failed when running C:\Users\Asus\anaconda3\lib\site-packages\edgeiq\__init__.py import MySQLdb报错ImportError: cannot import name '_mysql' from 'MySQLdb' (D:\python\lib\site-packages\MySQLdb\__init__.py) ImportError: cannot import name 'Nullable' from 'bokeh.core.properties' (C:\ProgramData\Anaconda3\lib\site-packages\bokeh\core\properties.py) importerror: cannot import name 'dump' from 'dump' (~/.local/lib/python3.8/site-packages/dump/__init__.py) Error: from matplotlib import _png ImportError: cannot import name '_png' from 'matplotlib' (C:\\Garden\lib\site-packages\matplotlib\__init__.py)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM