Streamlit deployment errors out with no module found error

https://appbankrupcyprevention-nrl5svnaaecdqncxm2ownl.streamlit.app/

  1. https://github.com/DhivyaMohan19/Streamlit_BankrupcyPrevention/blob/126af7d12882689de2566e37457b63037be5929d/requirements.txt

  2. Below is the error log

    [04:54:51] ❗️ installer returned a non-zero exit code

    ────────────────────── Traceback (most recent call last) ───────────────────────

    /home/adminuser/venv/lib/python3.13/site-packages/streamlit/runtime/scriptru

    nner/exec_code.py:129 in exec_func_with_error_handling

    /home/adminuser/venv/lib/python3.13/site-packages/streamlit/runtime/scriptru

    nner/script_runner.py:689 in code_to_exec

    /mount/src/streamlit_bankrupcyprevention/Bankruptcy_Prediction.py:15 in

    <module>

    12

    13 # Load your pre-trained model

    14 with open('bankruptcy_rfmdl.pkl', 'rb') as f:

    ❱ 15 │ model = pickle.load(f)

    16

    17

    18 #gathering the inputs

    ────────────────────────────────────────────────────────────────────────────────

    ModuleNotFoundError: No module named 'sklearn'

  3. Share the Streamlit 1.45.1 and Python 3.13.5 versions.

Welcome to the Streamlit community, and thanks for sharing your error log and repo! :tada: The error ModuleNotFoundError: No module named ‘sklearn’ means your app is trying to use scikit-learn, but it’s not installed in the deployment environment. This usually happens if scikit-learn isn’t listed in your requirements.txt file, or if the file is misnamed or misplaced.

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

Sources:

This is what the requirements.txt has. It still shows same error

python==3.13.5
pandas
scikit-learn==1.6.1
streamlit==1.45.1
pickle

when I launch the app, this is the 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.