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:

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?


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:


I hope that helps,