STreamlit not running on cloud well

Certainly, here’s a formulated error message that you can use to report the issue to Streamlit support:

javascriptCopy code

Error Message:

I’m encountering an issue when deploying my Streamlit app on Streamlit Cloud. The app runs without errors on my local machine, but I’m encountering the following error when running it on Streamlit Cloud:

File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/script_runner.py”, line 354, in _run_script
exec(code, module.dict)
File “/mount/src/whatsapp-chats-analyzer-app/chatsanalyzer.py”, line 393, in
time_counts[‘time’] = time_counts[‘time’].astype(str)
File “/home/adminuser/venv/lib/python3.9/site-packages/pandas/core/frame.py”, line 3896, in getitem
indexer = self.columns.get_loc(key)
File “/home/adminuser/venv/lib/python3.9/site-packages/pandas/core/indexes/base.py”, line 3797, in get_loc
raise KeyError(key) from err

Description: I have developed a Streamlit app for WhatsApp chat analysis, and it works perfectly on my local machine. However, when deploying the app on Streamlit Cloud, I encountered the above error. It appears to be related to a pandas DataFrame operation involving the ‘time’ column.

Steps to Reproduce:

  1. Upload the WhatsApp chat data.
  2. Run the Streamlit app on Streamlit Cloud.

Expected Outcome: The app should run without errors on Streamlit Cloud, just like it does on my local machine.

Actual Outcome: I encountered the error mentioned above when running the app on Streamlit Cloud.

Additional Information:

  • The app is developed using Python and relies on the Streamlit and pandas libraries.
  • The ‘time’ column in the DataFrame is in 24-hour format.
  • The app runs smoothly on my local machine but encounters this issue on Streamlit Cloud.

I would appreciate your assistance in resolving this issue so that I can successfully deploy my app on Streamlit Cloud. Thank you for your support.

You forgot to show us the error message. By the look of it, it seems that time_counts doesn’t have a column ‘time’.

thanks for your reply I was trying to analyze whatsapp chats. these are the codes and error messages i have


Screenshot 2023-09-07 062416

Even though the app works well and displays the time column perfectly on my local machine but doesnt does the same on streamlit cloud.

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