windows环境下,python使用network画图时显示报错"No module named 'community'"的解决方案

具体步骤(以下步骤都完成一遍)

  1. pip install python-louvain
    或者
    conda install python-louvain
  2. pip install community
  3. 在脚本中使用以下命令导入module:
    from community import community_louvain
  4. 在脚本中使用该模块时,可以通过诸如以下的方式:
    partition = community_louvain.best_partition(G)

注意:使用python 3的环境

参考链接:

https://github.com/snap-stanford/GraphRNN/issues/1

https://stackoverflow.com/questions/49923631/how-to-make-community-detection-with-networkx-module-works

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容