ModuleNotFoundError: No module named ‘matplotlib’

Streamlit App:

Github Repo:

ModuleNotFoundError: No module named ‘matplotlib’

Streamlit Version: 1.29.0

Python Version: 3.11.2

This application was deployed and working fine until I added a chart using matplotlib to it. I tried adding the requirements.txt file and my app still will not deploy. This is for a final project for college and I thought I was going to be done tonight (lol). It’s due next Thursday 12/7/2023.

Any help would be greatly appreciated.

I can’t find a requirements file in your repo.

I am facing the same problem.
I am trying to deploy my app on streamlit. Once I added the matplotib, it gave an error.

 Running install for matplotlib did not run successfully.
  │ exit code: 1
  ╰─> [542 lines of output]
          pkg-config is not installed.
          matplotlib may not be able to find some of its dependencies
 note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> matplotlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: You are using pip version 22.0.3; however, version 23.3.1 is available.
You should consider upgrading via the '/home/adminuser/venv/bin/python -m pip install --upgrade pip' command.
Checking if Streamlit is installed

This link is for my repo:
can you help ?

There is not enough context, my guess is that the python packages you are installing are too old for your python. Why did you chose those particular versions?

I ended up just not using matplotlib for this project :woman_shrugging: still not sure what the problem was.

I removed matplotlib and used a different graphing library. It was deploying fine without the requirements file before so I removed it. Works now.

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