标题:ptitprince 和 seaborn 出现导入错误 - 未找到“_CategoricalScatterPlotter”

问题描述 投票:0回答:1

我在尝试将 ptitprince 库与 seaborn 一起使用时遇到导入问题。按照ptitprince 0.2.7的要求安装seaborn版本0.11.0后,我遇到了依赖冲突,表明seaborn 0.13.0不兼容。调整seaborn版本后,我尝试导入ptitprince,但收到以下错误:

ImportError: cannot import name '_CategoricalScatterPlotter' from 'seaborn.categorical'

seaborn.categorical 模块中似乎没有 _CategoricalScatterPlotter。我检查了我的seaborn版本以确认我正在运行刚刚安装的版本是0.13.0

我不确定这个问题是否是由于版本不匹配造成的,或者类/函数是否在最近的seaborn更新中被删除或重命名。我正在寻找有关如何解决此问题的任何指导,以便我可以使用 ptitprince 来满足我的数据可视化需求。

还有其他人遇到过这个问题吗,或者有人知道如何解决这个问题或解决它吗?

我遇到 ptitprince 版本 0.2.7 和 seaborn 之间的兼容性问题。当我安装ptitprince时,它需要seaborn版本0.11.0。然而,安装后,我的终端报告与正在安装的seaborn 0.13.0有冲突,与ptitprince 0.2.7不兼容。

这是我的终端的错误消息:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ptitprince 0.2.7 requires seaborn==0.11, but you have seaborn 0.13.0 which is incompatible.

将seaborn降级到0.11.0以满足ptitprince要求后,我尝试导入ptitprince并遇到以下ImportError:

ImportError: cannot import name '_CategoricalScatterPlotter' from 'seaborn.categorical'

seaborn
1个回答
0
投票

我遇到了同样的问题并且已经解决了。通过查看源码,ptitprince需要seabron=0.11。如果你检查 0.11 seaborn 的 categorical.py,你可以在文件中看到 _CategoricalScatterPlotter。但是,如果你更新到0.13seaborn,在同一个seaborn的categorical.py中,你可以发现_CategoricalScatterPlotter不见了。我认为这是ptitprince方面没有用seaborn更新更新其代码的问题。

所以解决方案就是简单地将seaborn从0.13降级到0.11。

© www.soinside.com 2019 - 2024. All rights reserved.