No module named ‘matplotlib’ (again)

I have, like many others before me, now encountered the “No module named matplotlib” error.

What I have done so far:
I have a requirements.txt with “matplotlib” in it.
There are no folders in my app (it’s just a toy project).
The repo is public.

https://datingtimeline.streamlit.app/
https://github.com/MaximOtt/DatingTimelineStreamlit/tree/main
Python: 3.11.2
Streamlit: 1.30.0
Error:

ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)File "/mount/src/datingtimelinestreamlit/timeline.py", line 3, in <module>
    import matplotlib.pyplot as plt # Plotting
pandas
matplotlib
streamlit

…and do a reboot of your streamlit app.

Thanks for the quick reply. I updated the file just in case, but the behavior persists. How can I reboot it? I cleared the cache and refreshed the page, but this is probably not what you are talking about? I also changed the name back and forth a couple of times, because that seems to delete the app and deploy it again.

Thanks, this solved the issue. For everyone interested: It seems you need to reboot the app every time requirements.txt is updated.

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