Problem deploying streamlit app to Heroku -- Help needed!

I’m facing a singular problem in deployment of my app on Heroku, one which absolutely refuses to go away.
Here it is: (from the heroku app logs in the terminal). On the browser, the URL of the app throws an Application Error every single time.

I’ve consulted and followed every single thread of discussions from here on what could be wrong with my setup.sh, Procfile, and requirements.txt, but to no avail. I still get the same error always.

My file contents are as follows:
setup.sh

mkdir -p ~/.streamlit/
echo "[server]
headless = true
port = $PORT
enableCORS = false
" > ~/.streamlit/config.toml

My Procfile:
web: sh setup.sh && streamlit run app.py

My requirements.txt file also has streamlit mentioned with its version code which is 0.80.

I can’t figure out the problem. Any help is much appreciated! :slight_smile:
Thank you!

EDIT: Also tried with streamlit versions 0.69 and 0.49. No change.

Try with no version number for streamlit in requirements.txt, then Heroku will give you its latest available version.

Thanks for the reply!
Yes, I tried that. No change.

Have you tried to interact with the Heroku installation in the bash shell (online or using the Heroku desktop tools)? You can do a manual install and start your app in the console.

The detailed Heroku logs can shed more light than the basic deployment messages on what’s happening during installation.

Have you compared a pipreqs-generated requirements.txt file with your own? There may be some missing packages, and the deployment error message may actually be a red herring.

I’d also recommend you install the most basic “hello world” application first, if not already done.

Have you compared a pipreqs-generated requirements.txt file with your own? There may be some missing packages, and the deployment error message may actually be a red herring.

I’ve used the same requirements.txt to deploy my app and test it on the official Streamlit sharing. It works perfectly there.

Have you tried to interact with the Heroku installation in the bash shell (online or using the Heroku desktop tools)? You can do a manual install and start your app in the console.
The detailed Heroku logs can shed more light than the basic deployment messages on what’s happening during installation.

I don’t understand what you mean by manual installation. I did everything from the terminal itself. Created a new heroku app, added git remote for heroku, committed and pushed it to heroku master. What else do you mean?

I’d also recommend you install the most basic “hello world” application first, if not already done.

I could do this yeah. My application is almost a hello world application though. No extra ML libraries or anything like that. Just some basic Python functions in one app.py. In fact, I only have two files in the whole application to be deployed–requirements file and the app.py. That’s it.

If we can fork your code, we can try it ourselves. Anything else is just stabbing in the dark :open_mouth:

Do you have a reason for using Heroku, that Streamlit Sharing is not suitable for?

See this guide: Streamlit Deployment Guide (wiki)