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

I tried whole week but i cannot solve my problem please help me

my code -

diabetes_model = pickle.load(
    open(
        'D:/Programming/disease_detector/Disease_predictor_webapp/saved files/diabetes_model.sav',
        'rb'
    )
)

it thorws me this type of error ----

Traceback (most recent call last):
  File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/mount/src/disease-predictor/Disease_predictor.py", line 7, in <module>
    open(
FileNotFoundError: [Errno 2] No such file or directory: 'D:/Programming/disease_detector/Disease_predictor_webapp/saved files/diabetes_model.sav'

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/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)File "/mount/src/disease-predictor/Disease_predictor.py", line 7, in <module>
    open(

please help me how i fix this error

i rename my file with saved_files but it throws same error

If your streamlit app is hosted, you don’t have access to your local file system.
If you need help, please share your public github repo.
Probably this is the solution:

diabetes_model = pickle.load(open('saved files/diabetes_model.sav', 'rb'))

Thank you user you are great your solution is solve my error

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