ModuleNotFoundError: No module named 'matplotlib

Today I’ve run into a problem where all my repls have stopped working as I import matplotlib. It automatically started updating the repl and migrating it to Nix, and then received the following message:

Traceback (most recent call last):
  File "", line 1, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

Any suggestions would be appreciated!

This module should be in Python code help not general problem
Also, if you cannot find a module and got module error, try to type “pip install (the module name, in this case is matplotlib)”

1 Like

Thanks! And sorry that I posted in the wrong spot.

I then tried pip install matplotlib and end up with another bunch of error messages that I do not understand:

Traceback (most recent call last):
File “”, line 1, in
import matplotlib.pyplot as plt
File “/home/runner/Standing-Waves/venv/lib/python3.8/site-packages/matplotlib/**init**.py”, line 113, in
from . import _api, _version, cbook, _docstring, rcsetup
File “/home/runner/Standing-Waves/venv/lib/python3.8/site-packages/matplotlib/”, line 27, in
from matplotlib.colors import Colormap, is_color_like
File “/home/runner/Standing-Waves/venv/lib/python3.8/site-packages/matplotlib/”, line 56, in
from matplotlib import _api, _cm, cbook, scale
File “/home/runner/Standing-Waves/venv/lib/python3.8/site-packages/matplotlib/”, line 22, in
from matplotlib.ticker import (
File “/home/runner/Standing-Waves/venv/lib/python3.8/site-packages/matplotlib/”, line 138, in
from matplotlib import transforms as mtransforms
File “/home/runner/Standing-Waves/venv/lib/python3.8/site-packages/matplotlib/”, line 49, in
from matplotlib._path import (
ImportError: cannot open shared object file: No such file or directory

Here is a link to one of my repls:

If you post your topic in the wrong category, please do not create an entirely new topic. You should see a pencil icon next to your post to edit the category. If you don’t see the pencil, read around a bit more to increase your Trust Level.

My apologies again - I was going to make a new post and then delete the old one, but you beat me to it (I didn’t realize I could edit the category).