Hello, I have an error here and tried many times, but I didn't fixed it so can anyone help me to fix it

ModuleNotFoundError: 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 534, in _run_script
    exec(code, module.__dict__)File "/mount/src/used_cars/experment/main.py", line 3, in <module>
    from streamlit_option_menu import option_menu
the error says that there is no model called streamlit_option_menu but mention it in the file of requirements and it's version, so what's the wrong
2 Likes

Hi @hussein199623! :wave:

It seems like you are facing a ModuleNotFoundError for the streamlit_option_menu module in your app. Is the streamlit_option_menu module installed?

Thanks,
Charly

1 Like

No, I already installed it and ran it on my local server, so it’s working in local server but in deployment doesn’t work

1 Like

Can you please link to the repo?

1 Like

Here it’s my repo, https://github.com/hussein199623/used_cars

1 Like

Thanks, @hussein199623. However, I can’t access it – I believe it is private.

You can either make it public or grant me access - my GitHub handle is CharlyWargnier.

Thanks,
Charly

1 Like

I am sorry for that, I made it public now you can access it

1 Like

Typo in file name, should be: requirements.txt

1 Like

Good spot, @Franky1! :raised_hands:

1 Like

Thanks, after fixing it, it gives me this error Error installing requirements.

Click “Manage App” and consult the terminal for more details.

If you still have questions, leave a message in our forums and we will get back to you ASAP.

1 Like
  1. What is the error message?
  2. Use scikit-learn instead of sklearn
1 Like

Thanks, I have another error
FileNotFoundError: [Errno 2] No such file or directory: ‘decision.pkl’
should i mention it in the requirements file

1 Like

This file is likely a pre-trained machine learning model saved in Pickle format. You’ll need to ensure that the file decision.pkl actually exists in your project.

I hope this helps.

Thanks,
Charly

1 Like

Yes, I am sure of that

1 Like

The problem is that on streamlit cloud every file path must be relative to the root folder of the repo. This is not the case, because all your code and data is in a subfolder. I would move all files from the subfolder to the root folder and most of these issues are gone.

1 Like

I don’t know how to thank you, thanks a lot I appreciate that, there is one more thing i want to know why when i open my app on steamlit open in the second page not in the first page, may you help me to fix this

1 Like

Hey @hussein199623

I wanted to have a look at the repo (https://github.com/hussein199623/used_cars) but it’s 404’ing again. Have you switched it back to private?

1 Like

(post deleted by author)

1 Like

My bad, because I deleted the repo and reinstalled it again here is the new link

I want to, when I open the app it opens on the second page, but I want it to start from the home page, how can I do it

1 Like