python - 导入错误 : cannot import name 'ABCIndexClass' from 'pandas.core.dtypes.generic'

标签 python pandas pandas-profiling

我有这个输出:

[Pandas-profiling] ImportError: cannot import name 'ABCIndexClass' from 'pandas.core.dtypes.generic'


尝试以这种方式导入 pandas-profiling 时:
from pandas_profiling import ProfileReport
它似乎正确地导入了 pandas-profiling,但在与 pandas 本身交互时却遇到了困难。这两个库目前都通过 conda 更新。根据他们的文档,它似乎与 pandas-profiling 相关的任何常见问题都不匹配,而且我似乎找不到更通用的导入名称 ABCIndexClass 的解决方案.
谢谢

最佳答案

Pandas v1.3 更名为 ABCIndexClassABCIndex . visions pandas-profiling 的依赖关系包还没有 catch ,所以找不到时抛出错误ABCIndexClass .将 pandas 降级到 1.2.x 系列将解决此问题。
或者,您可以等待 visions要更新的包。

关于python - 导入错误 : cannot import name 'ABCIndexClass' from 'pandas.core.dtypes.generic' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68704002/

相关文章:

python - 在特定路径中的简单数据库表转储

python - 这个简单的 python 代码有什么问题?

python-3.x - 获取值错误 : The indices for endog and exog are not aligned

python - 在 df.loc 过滤条件中填充缺失数据?

python - 将 pandas 数据框列导入为字符串而不是 int

pandas-profiling - Pandas 分析 KeyError

python - 使用值列表从 Pandas 数据框中选择行

python - 使用 pandas_profiling 运行 ProfileReport 时如何解决 TypeError?

matplotlib - 无法在 Databricks 上运行 Pandas 分析

Python与无限集成