FileNotFoundError: [Errno 2] No such file or directory:

hi. I tried to deploy a streamlit app to render, but I got the following error:

FileNotFoundError: [Errno 2] No such file or directory: 'images/icon.png'

File "/opt/render/project/src/.venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/", line 552, in _run_script
    exec(code, module.__dict__)File "/opt/render/project/src/", line 149, in <module>
    main()File "/opt/render/project/src/", line 26, in main
    icon ='images/icon.png')File "/opt/render/project/src/.venv/lib/python3.9/site-packages/PIL/", line 3236, in open
    fp =, "rb")

I’m pretty sure that there is a file named icon.png in a folder called images in the same directory as the .py file. The web app runs perfectly locally until it is deployed to render. What could be wrong, and how do I solve this issue, please?


A common issue, when the path seems correct, can be file-casing.

Render uses Linux, which has a case-sensitive filesystem. Ensure the referenced filepath in your code is the same as it appears in your git repo. e.g. images/icon.png would be different to images/Icon.png


Thank you very much. it is actually image/icon.PNG not images/icon.png

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