No module named 'matplotlib'

I am unable to deploy my app because of a No Module named ‘matplotlib’ error. I noticed other people had this issue but I followed the instructions by adding a requirements.txt file and including locks. At a loss for what I should do unless I am just completely missing something.

1 Like

this is no longer an issue. When I moved the dashboard and requirements to the main folder the issue went away. Not sure I fully understand why but it is solved now

I think Streamlit was not able to read the requirement.txt that is why it was showing No Module named matplotlib. When you shifted the files to the main directory it was able to detect the requirements.txt thus it resolved the issue.

Hi !
I had succesfully deployed a streamlit app which had matplotlib working fine completely since then.
But suddenly today its showing we have encountered an error and its showing no module found named matplotlib.
My requirements.txt file is at the top level also. Why it has happened now? could not rectify.
Need to work on that…
Regards,
Akash

Please share your public github repo if possible.

Thanks for the reply!
Here it is…
Akash743/Solar_Power_Forecasting: Solar Power Forecasting (github.com)

You don’t have matplotlib in your requirements.txt

1 Like

@Franky1 …Thanks
Actually by mistake I had committed new requirements.txt file which was to be used in another repo in that repo… Sorry for wasting your time :slight_smile: and thanks again

hello
i am trying to compile in anaconda prompt, though i have the matplotlib in the requirements.txt ,it is showing the same error

please let know what to be done soon
thank you

same here. for one of the repos throws same error.

I faced the same error "ModuleNotFoundError: No module named ‘matplotlib’ "

@Amaresh_1

typo: requirments.txt

1 Like

How to remove the conflict error ? It’s caused by the version of the packages in the requirements.txt file . How to use the particular version of that packages ?

Which error?
Btw, remove keras, it is part of tensorflow.

I’m having a similar but not quite the same issue. Except it is for matplotlib.pyplot.

I can confirm it is in my requirements.txt file, my rep is linked here

  • change the file name to lowercase
  • remove the line matplotlib.pyplot from the file
  • do a reboot of the app

That seemed to resolve the matplotlib situation by changing the requirements file to lowercase.

Is there a similar process for importing internal functions? For example, I am now receiving the following error (trying to import a function I created):
File “/mount/src/stock_market_assessment/streamlit/pages/1 - WTDOLLE.py”, line 12, in
from functions.generate_db import *

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