【问题标题】:mpld3.fig_to_html throws AttributeError: module 'matplotlib.dates' has no attribute '_SwitchableDateConverter'mpld3.fig_to_html 抛出 AttributeError:模块“matplotlib.dates”没有属性“_SwitchableDateConverter”
【发布时间】:2021-11-27 05:55:56
【问题描述】:

我在过去三个月使用 mpld3.fig_to_html,它工作正常,但从最近两天开始,它显示错误。我所有的代码都停止工作。谁能建议我如何解决这个错误?

AttributeError: module 'matplotlib.dates' has no attribute '_SwitchableDateConverter'

此外,这个简单的代码也会引发同样的错误。

fig = plt.figure()
plt.scatter([1, 10], [5, 9])
html_graph = mpld3.fig_to_html(fig)

协作文件:https://colab.research.google.com/drive/17W1_vfOZTYmhodzziNEC7wPiuZuF9Cc1?usp=sharing.

【问题讨论】:

  • 你的python版本是什么
  • Python 版本:3.7.12

标签: python html matplotlib mpld3


【解决方案1】:

如果您使用的是 colab,请重新启动运行时,然后使用 !pip install matplotlib==3.2.1 mpld3==0.5.5 重新安装较旧的 mpld3 版本

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-01-07
    • 2017-08-24
    • 2016-03-03
    • 1970-01-01
    • 2018-04-14
    相关资源
    最近更新 更多