Do anyone one know how i can Push the code in Streamlit with Library Sklearn cause im getting error that streamlit cloud doesn’t support sklearn lib. Kindly Help ![]()
Hey there, thanks for reaching out to the Streamlit community!
This is a super common issue, and the good news is it’s easy to fix. The error happens because the package name for scikit-learn is scikit-learn, not sklearn, in your requirements.txt file. Streamlit Cloud installs dependencies based on that file, so you need to add scikit-learn (not sklearn) to it.
Here’s what you should do:
- Open your requirements.txt file.
- Add this line (or update it if it says sklearn):
scikit-learn - Save the file, commit, and push it to your GitHub repo.
- Reboot or redeploy your app on Streamlit Cloud.
If you still see errors, double-check for typos (like requirements.txt vs. requirement.txt) and make sure the file is in the root of your repo. For more details, see the official docs and community solutions: ModuleNotFoundError No module named - Streamlit Docs, App dependencies - Streamlit Docs, and Forum example.
Sources:
what is the error you are facing while deploying it on Streamlit Cloud? You will find the logs in Manage app. And keep it named as requirements.txt instead of Requirements.txt
Hi, it looks that you are installing both scikit-learn AND sklearn but…
“sklearn” is the deprecated version of the scikit-learn package and since it is listed AFTER the correct one, it overwrites the previous installation.
Please change your requirements.txt to (remove the “sklearn” line):
streamlit
pandas
numpy
plotly
scikit-learn
Also, note that it’s a good practise to pin your requirements instead of leaving them free to change version at each deploy: for example, I strongly encourage you to improve your requirements.txt to something like:
streamlit==1.53.0
pandas==2.3.3
numpy==2.4.1
plotly==6.5.2
scikit-learn==1.8.0
(or similar depending on the compatibilty of each library with all the others).
Also, I noticed that your file is named “Requirements.txt” but I suggest you to rename it lowercase (so “requirements.txt”)
Finally, please change the discussion title with something more specific (“Scikit-learn requirements errors” for example)

