Why can't my matplotlib import in more than one file

Question:

I have 2 Jupyter notebooks in the same folder. In both of them, I import matplotlib. In the first one matplotlib runs as usual, but in the second one an error like this occurs:

Traceback (most recent call last)
c:UsersHPDocumentsmy python for data science and mlbasicmatplotlibbasicMatplotlib.ipynb Cell 1 in <cell line: 2>()
      1 import numpy as np
----> 2 import matplotlib.pyplot as plt

ModuleNotFoundError: No module named 'matplotlib'

This is a screenshot of the error:

error image

On the left: file runs normally.
On the right: file error.

Asked By: T Maulana A.L

||

Answers:

try to install matplotlib in terminal

Answered By: Gustavo Michel