How do I install "matplotlib" for Python?

I’ve been following the tutorials, specifically this one, and it wants me to import pyplot from matplotlib. However, I need to first instal matplotlob because executing:

from matplotlib import pyplot as plt

plt.plot([1,2,3,4,5,6], [6,3,6,1,2,3])
plt.show()

gives me error:

“Traceback (most recent call last):
File “main.py”, line 1, in
from matplotlip import pyplot as plt
ModuleNotFoundError: No module named ‘matplotlip’

The tutorial states I can install via the “‘magic import’ functionality”. I’m using a Chromebook, and the article states earlier that I can work with graphs on “windows using [OS] X and rendering the plots there.” Is there any way I could install matplotlib?

it’s supposed to be matplotlib but according to the error you’re importing matplotlip just go to to shell and enter pip install matplotlib if error persists

1 Like

Thanks! It was the pip install matplotlib that I never did that caused the error.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.