13

When I run this code:

import networkx as nx

G = nx.complete_graph(5)

nx.draw_networkx(G)

I got this error: AttributeError: module 'matplotlib.cbook' has no attribute 'iterable'

How can I get rid of that error? And thank you.

P.S. I run that code in the cloud, not on my laptop.

3
  • Maybe some versions are out of sync? You could try to upgrade both networkx and matplotlib. Commented Jul 31, 2020 at 20:03
  • Does this answer your question? Matplotlib AttributeError: module 'matplotlib.cbook' has no attribute '_define_aliases' Commented Jul 31, 2020 at 20:05
  • It does not help. I upgraded both networkx and matplotlib but the error remain. Commented Jul 31, 2020 at 20:54

3 Answers 3

8

Just ran into this issue and found that upgrading networkx works perfectly

pip install --upgrade networkx
Sign up to request clarification or add additional context in comments.

Comments

7

Downgrade matplotlib version to 2.2.3

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

Comments

0

upgrade your networkx version can also do

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.