Reputation: 219
I successfully installed networkx
using pip install networkx
. I also tested it with Python using command prompt, and it worked.
Now, when I tried importing the module in Python IDLE, it throws the following error:
Traceback (most recent call last):
File "C:/Users/hp/Desktop/PROJECTS/osmnx/test.py", line 1, in <module>
import networkx
ModuleNotFoundError: No module named 'networkx'
Upvotes: 7
Views: 20164
Reputation: 679
If your script is running using conda environment you can use:
conda install networkx -y
So this will install networkx using conda package manager.
It helped for my case: import networkx
started working.
Upvotes: 2
Reputation: 219
I solved the problem by upgrading my Python from 3.7.3 to 3.8.5. I ran the import statement after that, but it showed the same error. With that, what I did is to run the pip install networkx
again in the Command Prompt, and it finally worked!
Upvotes: 1