参考链接:https://blog.csdn.net/qq_40644291/article/details/106915733
用sklearn时from sklearn.clusterimport KMeans
报错 cannot import name comb
解决方法:
找到Anacanda或python下的下面两个文件(推荐安装Anaconda,库的安装导入错误会减少)
修改lib\site-packages\sklearn\model_selection\_split.py中from scipy.misc import comb为from scipy.special import comb(我没有这个就没改)
修改lib\site-packages\sklearn\metrics\cluster\supervised.py中from scipy.misc import comb为from scipy.special import comb(改了这个就好了)
网友评论