0
khalidali@Khalids-MacBook-Pro lab4 % /usr/local/bin/python3 "/Users/khalidali/Desktop/CSE 107/lab4/test_HistogramEqualization.py"
Traceback (most recent call last):
  File "/Users/khalidali/Desktop/CSE 107/lab4/test_HistogramEqualization.py", line 33, in <module>
    plot_histogram( dark_hist )
  File "/Users/khalidali/Desktop/CSE 107/lab4/My_HE_functions.py", line 51, in plot_histogram
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

I installed Matplotlib using pip3 install matplotlib

wjandrea
  • 28,235
  • 9
  • 60
  • 81
  • 1
    Try `python3 -m pip install matplotlib`. [This thread](https://stackoverflow.com/questions/18176591/importerror-no-module-named-matplotlib-pyplot) also has the exact same issue if you want to take a look at other solutions posted there. – clxrity Nov 10 '22 at 19:51
  • 1
    Or even try `/usr/local/bin/python3 -m pip install matplotlib` – wjandrea Nov 10 '22 at 20:03
  • Does this answer your question? [ImportError: No module named matplotlib.pyplot](https://stackoverflow.com/questions/18176591/importerror-no-module-named-matplotlib-pyplot) – BeeFriedman Nov 10 '22 at 20:27
  • If your script is executed by `/usr/local/bin/python3`, then the script will find ONLY the modules that had been installed by `pip`, as run by `/usr/local/bin/python3`. In other words, the [comment](https://stackoverflow.com/questions/74394548/module-not-found-matplotlib-in-vscode-mac-os#comment131333323_74394548) by @wjandrea seems really on spot. – gboffi Nov 11 '22 at 22:37

0 Answers0