ModuleNotFoundError for matplotlib during deploying

Dear all, firstly I would like to thanks the great and friendly community. I have ran into some troubles handling the environments until finally making it work and now the app itself is working!

Then I moved to the next step (to deploy it) and here comes the problem: the app is working fine, however it seems that I am perhaps messing up with the requirements.txt.

Here follows the error

the log produced is the following:

"[client] Connecting…
[manager] Starting up for owner: ‘viniciushenning’, repository: ‘projects’, branch: ‘master’, main module: ‘burned-brazil/webapp/’
[manager] Cloning repository …
[manager] Cloning into ‘projects’…

[manager] Cloned repository!
[manager] Processing dependencies …
[manager] Processed dependencies!

You can now view your Streamlit app in your browser.

Network URL:
External URL:"

My requirements.txt:

here is the github webpage where it is in:

Any further information needed I would be pleased to provide.
P.S.: I went across several topics about NotFoundModuleError, however any of the solutions solved my issue.

Thanks once more and have an amazing week =)

1 Like

Hi @ViniciusHenning, welcome to the Streamlit community!

One thing that stands out to me in your app is this line:

I’m not too familiar with different backends, but I’m wondering if this backend requires a system-level package like cairo or tkinter that isn’t installed. Is it possible for you to use matplotlib without the lock code, to try and narrow down the issue to the chosen backend?


Hey @randyzwitch thanks for the time in trying to help me!

Throughout the journey of studying streamlit and how it works I came across
some issues with matplotlib. While trying to solve these issues, I found some
that could produce some problems in the future (related to using different threads
and constructing figures).

As in the part two of my app I combine different axis in the same figure, I was wondering
that could generate wrong plots (I confess that I don’t know if my concern makes sense)
but I give it a try anyway. My app kept working (with that backend) and I let it there. But I can perfectly comment the lines and the app still works but the error persists.

Summing up, I can remove it my app still works but while deploying it I still get the error.

Thanks once more,