close

[Solved] No module named ‘sklearn.datasets.samples_generator’

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error No module named ‘sklearn.datasets.samples_generator’ 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.datasets.samples_generator’ Error Occurs?

Today I get the following error No module named ‘sklearn.datasets.samples_generator’

How To Solve No module named ‘sklearn.datasets.samples_generator’ Error ?

  1. How To Solve No module named 'sklearn.datasets.samples_generator' Error ?

    To Solve No module named 'sklearn.datasets.samples_generator' Error In the latest versions of scikit-learn, there is no module sklearn.datasets.samples_generator – it has been replaced with sklearn.datasets (see the docs); so, according to the make_blobs documentation, your import should simply be:

Solution 1

In the latest versions of scikit-learn, there is no module sklearn.datasets.samples_generator – it has been replaced with sklearn.datasets (see the docs); so, according to the make_blobs documentation, your import should simply be:

from sklearn.datasets import make_blobs

As a general rule, the official documentation is your best friend, and you should definitely consult it first before anything else.

Solution 2

Try using pip3

pip3 install -U scikit-learn

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