FileNotFoundError config.yaml in streamlit

https://centumjoon-streamlit-website-joon-mainstreamlit-webhome-a2jwz3.streamlit.app/


File "/home/appuser/venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 564, in _run_script
    exec(code, module.__dict__)
File "/app/streamlit_website_joon-main/streamlit_website_joon-main/streamlit_web/🏡Home.py", line 530, in <module>
    with open('./config.yaml') as file:
type or paste code here

You can use cwd = os.getcwd() to get the current path, and then use the full path to the config file.

with open('/app/streamlit_website_joon-main/streamlit_website_joon-main/streamlit_web/config.yaml') as file:
    config = yaml.load(file, Loader=SafeLoader)

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