Getting ModuleNotFoundError: No module named 'sklearn'

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 am trying to use “from sklearn.neighbors import NearestNeighbors” for my project. Any help appreciated!

Github Repository: GitHub - ElaineJ123/hobbies
Streamlit page: https://hobbies-2023.streamlit.app/

Hi @ElaineJ123,

It seems like your repo is private. Would you mind making it public, or sharing the code privately so we can review, please?

Thanks,
Charly

On a side note, while it can be challenging to diagnose without seeing the files, sometimes the latest version of a library may have issues. You can try pinning a specific known-to-work version of scikit-learn in the requirements.txt. For instance:

scikit-learn==1.3.0

https://pypi.org/project/scikit-learn/1.3.0/

I hope that helps,
Charly

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.