Config.toml do not work after deployed

Not exactly.

When you deploy from Streamlit Cloud, people assume that a cd mydir happens, because that’s what a lot of people do on local development. This would imply a run command of:

streamlit run streamlit_app.py

But what Streamlit Cloud always does is starts at the top-level, passing in the entire path that the user puts into the launch window. This implies a run command of:

streamlit run apps/myapp/v2/justkidding/v7/streamlit_app.py

So when people go from their local environment development to Streamlit Cloud, references like this will break:

with open('file.txt', 'r'):
   do_something()

While one could argue that Streamlit Cloud should be a “do what I mean” system, this is why we suggest that users make their path references using pathlib or similiar package, to programmatically determine where they are in the file tree so that the code is robust across any deployment platform.

Best,
Randy

1 Like