Skip to content Skip to sidebar Skip to footer

How To Fix Modulenotfounderror: No Module Named 'networkx.drawing'; 'networkx' Is Not A Package

This is a short python script: import matplotlib.pyplot as plt import networkx as nx from networkx.drawing.nx_agraph import graphviz_layout G = nx.DiGraph() when it is executed b

Solution 1:

You have named your file networkx.py. When importing networkx the local file has precedence over the installed package.

Just rename your networkx.py and make sure to delete your __pycache__ folder if there is one.

Post a Comment for "How To Fix Modulenotfounderror: No Module Named 'networkx.drawing'; 'networkx' Is Not A Package"