ModuleNotFoundError: No module named 'matplotlib' while deploying

Hi, I’m new to Streamlit, used pipreqs to create requirments.txt
I could able to run the code locally, getting a module error while deploying

Here’s my code snippet,


import requests
import numpy as np
import pandas as pd
from datetime import date
from datetime import timedelta
import os
import matplotlib.pyplot as plt
from IPython.display import display
from keras.models import Sequential
from keras.layers import LSTM, Dense
from sklearn.preprocessing import MinMaxScaler

today = date.today() 
yesterday = today - timedelta(days = 2)
date = []
link = []
for i in range(365):
  d = yesterday - timedelta(days=i)

Requirements.txt file,

Hi @Bavi, welcome to the community! :wave:

The dependency filename is supposed to be requirements.txt, not requirements (2).txt.

Once you rename the file in your repo, the dependencies listed within them should get installed.

Hi, thank you!
Changed the file name to ‘requirements.txt’
Getting this,

Requirements.txt file:

ipython==8.5.0
keras==2.8.0
matplotlib==3.2.2
numpy==1.21.6
pandas==1.3.5
requests==2.23.0
scikit_learn==1.1.2
streamlit==1.13.0

Have you saved the requirements.txt file and uploaded it to the github repo? If it’s still not working, can you share the link to your repository?

Hi, yeah I have saved and uploaded it in github repo.
Sure, Here’s the link

After re-running got this error,

Thank you!

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