包引入报错 ImportError: cannot import name ‘best_partition‘ from ‘community‘

简介: 包引入报错 ImportError: cannot import name ‘best_partition‘ from ‘community‘

包引入报错 ImportError: cannot import name ‘best_partition‘ from ‘community‘


目录

一、问题描述

二、解决方法

一、问题描述

Python 代码中引入包:from community import best_partition 时报错:

ImportError: cannot import name 'best_partition' from 'community'

二、解决方法

虽然 best_partition 是在 community 中,但是装了 community 包仍然报错。

正确解法是删除 community 相关包,并下载安装 python-luovain用于社区检测的louvain算法

以上,问题解决~

相关文章
|
10月前
|
安全 开发者 C++
Windows10安装modelscope后import这个模块报错:OSError: [WinError 1] 函数不正确。: 'D:\Anaconda\envs\MDS\lib\site-packages\modelscope\utils\ast_utils.py'
Windows10安装modelscope后import这个模块报错:OSError: [WinError 1] 函数不正确。: 'D:\Anaconda\envs\MDS\lib\site-packages\modelscope\utils\ast_utils.py'
307 1
|
6月前
|
Python
pandas包的安装和Could not find a version that satisfies|9
pandas包的安装和Could not find a version that satisfies|9
98 8
|
10月前
|
编译器 Python
Python 完美解决 Import "模块" could not be resolved ...
Python 完美解决 Import "模块" could not be resolved ...
302 0
|
编译器 Python
Python 完美解决 Import “模块“ could not be resolved ...
Python 完美解决 Import “模块“ could not be resolved ...
393 0
|
机器学习/深度学习 人工智能 数据挖掘
|
存储 Java Unix
Python中的模块、包、import module1,mudule2、from…import、from … import *、as、定位模块、模块中的__all__和__name__、模块的注意点
在Python中用关键字import来引入某个模块,比如要引用模块math,就可以在文件最开始的地方用import math来引入想一想:为什么必须加上模块名调用呢?因为可能存在这样一种情况:在多个模块中含有相同名称的函数,此时如果只是通过函数名来调用,解释器无法知道到底要调用哪个函数。所以如果像上述这样引入模块的时候,调用函数必须加上模块名通过这种方式引入的时候,调用函数时只能给出函数名,不能给出模块名,但是当两个模块中含有相同名称函数的时候,后面一次引入会覆盖前一次引入。也就是说假如模块A中有函数fun
255 1
Python中的模块、包、import module1,mudule2、from…import、from … import *、as、定位模块、模块中的__all__和__name__、模块的注意点
|
程序员 Android开发
使用 Eclipse 建立包的时候,“name”下可选项“Create package-info.java”的作用是什么?
使用 Eclipse 建立包的时候,“name”下可选项“Create package-info.java”的作用是什么?
148 0
使用 Eclipse 建立包的时候,“name”下可选项“Create package-info.java”的作用是什么?
|
Python
python使用import引用不了configparse模块等问题解决办法
python使用import引用不了configparse模块等问题解决办法
212 0
|
Python
rqalpha安装后使用报错:numpy.core.multiarray failed to import
rqalpha安装后使用报错:numpy.core.multiarray failed to import
110 0
|
Python
import statsmodels.api as sm 时 ImportError: DLL load failed while importing _arpack: 找不到指定的程序。
import statsmodels.api as sm 时 ImportError: DLL load failed while importing _arpack:
1217 0