close

[Solved] No module named ‘sklearn.neighbors._base’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error No module named ‘sklearn.neighbors._base’ in Python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How No module named ‘sklearn.neighbors._base’ Error Occurs?

Today I get the following error No module named ‘sklearn.neighbors._base’ in Python.

How To Solve No module named ‘sklearn.neighbors._base’ Error ?

  1. How To Solve No module named 'sklearn.neighbors._base' Error ?

    To Solve No module named 'sklearn.neighbors._base' Error If it is in a particular env, you must copy the _base file or base file to the env from package file.
    I had the same problem in my tensorflow env. I just copied _base and base file to my tensorflow env and worked.

  2. No module named 'sklearn.neighbors._base'

Solution 1

If it is in a particular env, you must copy the _base file or base file to the env from package file.

I had the same problem in my tensorflow env. I just copied _base and base file to my tensorflow env and worked.

Solution 2

Previous sklearn.neighbors.base has been renamed to sklearn.neighbors._base in version 0.22.1.
You have probably a version of scikit-learn older than that. Installing the latest release solves the problem:

pip install -U scikit-learn

or

pip install scikit-learn==0.22.1

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment