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

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/app/ipl-first-innings-score-prediction/app.py", line 6, in <module>
    pipe = pickle.load(open('E:/projects/ipl project/pipe.pkl','rb'))

please give solution for this error

If your streamlit app runs on a hosted environment, you don’t have access to the Client’s computer.

@Sarang_Gami

This error occurs while running a Streamlit app because the code is trying to load a pickle file from a specific location “E:/projects/ipl project/pipe.pkl”, but that location may not be accessible or may not exist in the current environment where the app is being run.

There are a few potential reasons why this error might be occurring:

  1. The pickle file does not exist in the specified location.
  2. The pickle file exists in the specified location, but the Streamlit app does not have permission to access that file.
  3. The Streamlit app is being run on a different operating system or environment than the one where the pickle file was created, causing compatibility issues.

To fix this error, you can try the following steps:

  1. Double-check the file path to make sure that it exists and is accessible from the current environment.
  2. Make sure that the file has the correct permissions for the Streamlit app to access it.
  3. If the app is being run on a different environment, try re-creating the pickle file on the current environment to ensure compatibility.

thanks sir i changed the file path because this problem is while deploy so i used only ‘pipe.pkl’ and in requirements.txt i added the scikit-learn because of pkl model file… issue is solved…thanks for helping i just made silly mistake.

Hey @Sarang_Gami,

Happy to help, Don’t worry for making mistake. Nobody is perfect. Keep up your work.

2 Likes

I am getting same error while working a lot on this, still it is not resolving. As I have check path of file , persmmission of files also. All of this are ok.