问题描述:
在使用community时,很多时候明明导入了community库,可是在调用community.best_partiton()方法是,总是报错:AttributeError: ‘module’ object has no attribute ‘best_partition’。Ctrl+Z进入_init_.py文件后,发现里面什么内容也没有。
问题原因:
出现上述情况多半是因为,没有安装库文件python-louvain。
解决:
在库文件中再安装另一个库文件python-louvain,问题就完美解决啦。