Got an error while deploying

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)

What is the meaning of this error?

Traceback:

File “/mount/src/credit-wise-loan-approval-system/app.py”, line 4, in
from sklearn.linear_model import LogisticRegression

Hey there, thanks for your question! This error means your Streamlit app tried to import sklearn (scikit-learn), but the library isn’t installed in your deployment environment. On Streamlit Community Cloud, this usually happens if scikit-learn isn’t listed in your requirements.txt file, or if the file is missing or misnamed (e.g., requirement.txt instead of requirements.txt). The error message is partially redacted for security, but the root cause is a missing dependency—scikit-learn.

To fix it, add scikit-learn to your requirements.txt file (not sklearn), save, commit, and push to your repo. Then redeploy or reboot your app. For more details and examples, check the official docs and FAQ: ModuleNotFoundError No module named - Streamlit Docs, App dependencies - Streamlit Docs, and FAQ: ModuleNotFoundError.

Sources: