Pylint: how to fix ModuleNotFoundError: No module named ‘matplotlib’


I know I have matplotlib installed but I get an error when trying to run it. I tried to follow the steps here. but when I run it again I get the following:

python -u "/Users/MacBook/python/code/"
/Users/MacBook/.fzf.zsh:source:13: no such file or directory: /Users/xxxxx 1/.fzf/shell/key-bindings.zsh
/Users/MacBook/.zshrc:export:2: not valid in this context:
[email protected] python % python -u "/Users/MacBook/python/code/"
Traceback (most recent call last):
  File "/Users/MacBook/python/code/", line 2, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

This happens in VS code: I am running python 3.9.4

Source: Visual Studio Questions