[Errno 2] No such file or directory: 'predict_sentiment.pkl'

App link
Link to repo

Error

Traceback (most recent call last):

  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/script_runner.py", line 354, in _run_script

    exec(code, module.__dict__)

  File "/mount/src/createch-24-streamlit/streamlit_compiled.py", line 17, in <module>

    with open("predict_sentiment.pkl", "rb") as f:

FileNotFoundError: [Errno 2] No such file or directory: 'predict_sentiment.pkl'

App runs fine locally, but it not on deployent.

1 Like

Hi @ishan-surana,

Thanks for sharing this question!

This seems to be a path issue. The app cannot locate the file in your repo. Your repo link above is not opening btw; 404 Error.

I recommend checking the path on your repo and changing that appropriately so the code can locate the .pkl file.

1 Like