ImportError: cannot import name '_k_means'
See original GitHub issueHi. I install spherecluster usingpip install spherecluster
successfully in Ubuntu 18.04. But when I call from spherecluster import SphericalKMeans
, I got an ImportError.
Traceback (most recent call last):
File "LM/vectors_cluster.py", line 9, in <module>
from spherecluster import SphericalKMeans
File "/path_to_anaconda/lib/python3.6/site-packages/spherecluster/__init__.py", line 2, in <module>
from .spherical_kmeans import SphericalKMeans
File "/path_to_anaconda/lib/python3.6/site-packages/spherecluster/spherical_kmeans.py", line 16, in <module>
from sklearn.cluster import _k_means
ImportError: cannot import name '_k_means'
Here is my environmental information:
Package | Version |
---|---|
numpy | 1.14.3 |
scipy | 1.1.0 |
scikit-learn | 0.22.2.post1 |
pytest | 3.5.1 |
nose | 1.3.7 |
joblib | 0.14.1 |
spherecluster | 0.1.7 |
If anyone can help me, I would really appreciate it!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
importing KMeans from sklearn.cluster throws error #18841
Describe the bug. For some reason, I cannot import Kmeans from sklearn. cluster. However, importing other classes from sklearn.
Read more >Import error. Can't import kmeans_plusplus - Stack Overflow
According to the documentation, kmeans_plusplus is. New in version 0.24. so it is not available for the version 0.23.2 you are using.
Read more >No module named sklearn.cluster, Parameters extraction not ...
ImportError : No module named sklearn.cluster, Parameters extraction not yet performed! ... from ductape.phenome.clustering import mean, kmeans, plotClusters
Read more >Fix ModuleNotFoundError: No module named 'sklearn'
This error indicates that the scikit-learn (aka sklearn ) package was not installed, or even if it was installed for some reason it...
Read more >PYTHON : ImportError in importing from sklearn - YouTube
PYTHON : ImportError in importing from sklearn: cannot import name check_build [ Gift : Animated Search Engine ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems that downgrading the sklearn to the older version of 0.20.0 can solve the problem.
conda install scikit-learn=0.20.0
This is a workaround, not a solution. A side-effect of downgrading to 0.20.0 is that the OPTICS clustering algorithm is not available anymore. Can we re-open this issue, and find a proper solution for it?