close

[Solved] ImportError: No module named sklearn (Python)

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error ImportError: No module named sklearn (Python) 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 ImportError: No module named sklearn (Python) Error Occurs?

Today I get the following error ImportError: No module named sklearn (Python) in python.

How To Solve ImportError: No module named sklearn (Python) Error ?

  1. How To Solve ImportError: No module named sklearn (Python) Error ?

    To Solve ImportError: No module named sklearn (Python) Error you dont have the package scikit-learn installed, try this if you are in a terminal linux :

  2. ImportError: No module named sklearn (Python)

    To Solve ImportError: No module named sklearn (Python) Error you dont have the package scikit-learn installed, try this if you are in a terminal linux :

Solution 1

Make sure that pip and python are the same version. For example if you run pip for python 2.7, it will install the package only in 2.7, and if your python command point to for example python 3.3 interpreter, it will not have that package

Solution 2

you dont have the package scikit-learn installed, try this if you are in a terminal linux :

sudo pip install scikit-learn

if you want to install the package within your code use

import os 
os.system('sudo pip install 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