Reputation: 53
First, I must preface that there is an error going showing, but the normal fix isn't working. My code looks like this:
import matplotlib.pyplot as plt
x = [1,1,1]
y = [5,5,5]
plt.plot(x, y)
plt.xlabel('- Hours Spent Studying -')
plt.ylabel('- Test Scores (in %) -')
plt.title('- Science Scores -')
plt.show()
This, from what I understand about matplotlib, should graph the given points. The error that I am catching is:
import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'
I immediately assumed that I had not installed matplotlib correctly or in the correct directory, so I tried going into the directory where my python39 is installed, and tried pip install matplotlib
, which told me I had already installed matplotlib in the directory. Confused, I went back to my code directory and ran it again, and the same error occurred again.
Does anyone have any suggestions or fixes to why this would be happening? My operating system is Win10.
Upvotes: 0
Views: 133