r/learnpython • • 9m ago

Can't run matplotlib

I'm trying to make a graph using data points using matplotlib but for some reason, it's not working. I installed it using python -m pip install matplotlib and got a whole block of text with all the lines starting with, Requirement already satisfied. But, when I try to run, import matplotlib.pyplot as plt in my code, I get an error saying ModuleNotFoundError: No module named 'matplotlib'

Anyone know what the issue is and how I can get it resolved?

0 Upvotes

3 comments sorted by

•

u/Vorarbeiter 4m ago

You probably didn't install it in the same place you're trying to run it from

•

u/Ender_Locke 4m ago

are you installing globally but using a venv to run your python(or vice versa)

•

u/Necessary-Flounder52 3m ago

Are you running the code in the same environment in which you installed it, ie. the command line?