Problem Rendering matlibplot.pyplot donut chart

Hi Folks

I’ve been looking for hours for help on the error below, any help from the community would be ace!

App Deployed at
Repo at GitHub - PositivePython42/PandOura
Building on Python 3.11, error below.

I am building an app on the Streamlit platform. It will take in data from users of the Oura Ring and let them play with their data.

I am unable to get matplotlib.pyplot to work. I have run the plot building code in CoLob to make sure it works, which it does.

My StreamLit environment works fine with other features and plots that are note dependent on matplotlib.pyplot.

The error I get is noted below:

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/”, line 534, in _run_script exec(code, module.dict) File “/mount/src/pandoura/”, line 5, in import matplotlib.pyplot as plt

I have put the correct requirements.txt file in the GitHub repository that connects to Streamlit Community Cloud.

Any help very gratefully received.

I tried the code without the matplotlib.pyplot element and it works fine. I tried to code to create the donut chart in CoLab and that works fine too. I have used the command st.pyplot(fig) to try and render the plot.

The name of the module to install is matplotlib, not matplotlib.pyplot

1 Like

Thank you so much, that totally worked!

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