FileNotFoundError while Deploying streamlit app using GitHub repository to streamlit cloud

FileNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)File "/app/portfolio/Portfolio/1_🏠Homepage.py", line 10, in <module>
    profile_pic =Image.open("/Portfolio/assets/prt.jpg")File "/home/appuser/venv/lib/python3.9/site-packages/PIL/Image.py", line 3092, in open
    fp = builtins.open(filename, "rb")

Hi @Praneeth-official, welcome to the community! :wave:

The error should be resolved if you remove the / before Portfolio. Replace the following lines 10, 22, 74:

profile_pic =Image.open(os.path.join("/assets/prt.jpg"))
lottie_coding = load_lottiefile("lottiefiles/coding.json")
lottie_hello = load_lottiefile("lottiefiles/hello.json")

with the following:

profile_pic =Image.open("Portfolio/assets/prt.jpg")
lottie_coding = load_lottiefile("Portfolio/lottiefiles/coding.json")
lottie_hello = load_lottiefile("Portfolio/lottiefiles/hello.json")

Once you make the above changes to the filepaths, your app should successfully deploy :balloon:

Thank you very much @snehankekre.The problem has been resolved.Lots of thanks :)))))

1 Like