【问题标题】:AttributeError: module 'matplotlib.cbook' has no attribute 'iterable'AttributeError:模块'matplotlib.cbook'没有属性'iterable'
【发布时间】:2020-07-31 19:55:22
【问题描述】:

当我运行这段代码时:

import networkx as nx

G = nx.complete_graph(5)

nx.draw_networkx(G)

我收到此错误:AttributeError: module 'matplotlib.cbook' has no attribute 'iterable'

我怎样才能摆脱这个错误?谢谢。

附:我在云中运行该代码,而不是在我的笔记本电脑上。

【问题讨论】:

标签: python matplotlib networkx


【解决方案1】:

将 matplotlib 版本降级到 2.2.3

https://github.com/palash1992/GEM/issues/51

【讨论】:

    【解决方案2】:

    升级你的networkx版本也可以

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2019-04-24
    • 2022-06-26
    • 2018-04-14
    • 2019-02-18
    • 1970-01-01
    • 2020-01-01
    • 2019-07-20
    • 2021-11-05
    相关资源
    最近更新 更多