No module named 'sklearn'

Search the logs for messages related to the installation of scikit-learn.

1 Like

I don’t see scikit-learn mentioned in the logs. Just that error: "ModuleNotFoundError: No module named ‘sklearn’ "

1 Like

I forked from 4f2302f and deployed to Streamlit Cloud and I couldn’t reproduce the issue. scikit-learn was installed and sklearn.neighbors succesfully imported. Try rebooting or redeploying your application.

There are other potential issues though, probably due to the very old versions you are specifying.

1 Like

I’m having the same issue. I’m getting this error: ModuleNotFoundError: No module named ‘sklearn’
I don’t think I have any typos, and I have “scikit-learn” in my requirements.txt and “import sklearn” in my code

here my streamlit :https://heartdisease-predict.streamlit.app/
here my repo :
GitHub - AfandyRidwan/heart_disease: Heart Disease Prediction model with Random Forest Classifier

1 Like

@af1

Try rebooting or redeploying your application.

1 Like

I’m having the same problem

1 Like


the error. Please i need help

1 Like

Please share a link to your GitHub repo and the deployed app

1 Like

Hey Streamlit team!

i am facing very similar issues as well. Please help!
my app: Streamlit (test-bikewayfinder.streamlit.app)
github: GitHub - jzhenli1/priv_test

Everything works fine on my local computer but this error appears when i deploy my app in the streamlit cloud

thanks in advance

1 Like

I’m facing the same issue and was not able to solve it. Kindly check the issue.
Github - GitHub - SanthoshkumarSelvakumar/Detection_Of_Heart_Disease: Created a streamlit website where people are expected to enter the required values to find whether they have a heart disease or not.
Webapp - https://detectionofheartdisease.streamlit.app/

1 Like

i am facing the same error:
github link: GitHub - shubham-bhagwat/tensml-challenge

1 Like

Hi @Santhoshkumar . Just remove the version number of scikit learn from requirements.txt file and add the package named joblib| also downgrade the python version to 3.9 in cloud app settings. Definitely it will works.
Happy Streamlit-ing :balloon:

1 Like

Hi @Shubham_Bhagwat . The repo is not working. Kindly check the link.

1 Like

ModuleNotFoundError: No module named ‘sklearn’
link:Update bbb.py · mohamed45679/nn@d8e8a0f · GitHub

1 Like
1 Like