Sunday, May 3, 2020

no module named 'sklearn' problem while running python code.

This error occurs when there is no 'sklearn' installed package in your system. This problem can be solved by installing this package through the windows command tool. Follow the below instructions to install this package 👇👇--

-- First, we have to find the path of the installed directory of the Python tool. The path will be like C:\Users\Accountname\AppData\Local\Programs\Python\Python38-32\Scripts.  
-- After finding the path create notepad in Scripts folder with name local and write cmd in that notepad and change the extension of the file from .txt to .bat. Now, the file name is like "local.bat". 
-- Now, Open this local.bat file. You can see the command window. 
-- Type pip install sklearn. sklearn package will download and install automatically. 

Now, you can check in IDLE (Python) to confirm this package installed in your system using the following command.

-- from sklearn import datasets.

 This installation is successful only when there is no error while running this command.


 All the best... 👍

No comments:

Post a Comment