You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

plotnine==0.9与matplotlib==3.6兼容异常:缺失matplotlib._contour模块

解决plotnine0.9与matplotlib3.6的兼容报错

问题现象

使用plotnine==0.9搭配matplotlib==3.6时,会抛出模块找不到的错误:

File "D:\Python\Python310\lib\site-packages\plotnine\stats\stat_density_2d.py", line 3, in <module>
    import matplotlib._contour as _contour
ModuleNotFoundError: No module named 'matplotlib._contour'

解决方案

将matplotlib版本降级至3.5系列即可解决该问题,执行以下命令完成降级:

pip install matplotlib==3.5.*

内容的提问来源于stack exchange,提问作者Haoran Yi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 01:05:17