Sayan Sen
Sayan Sen

Reputation: 11

import sklearn fails despite using pip3 install in cmd

Have tried following steps in sequence:

  1. cmd prompt :

pip3 install sklearn

shows

requirement already satisfied. sklearn and scikit-learn directories get printed

  1. Spyder code editor :

import sklearn as sk_learn. Result : ModuleNotFoundError: No module named 'sklearn'

Windows 10. Further details below:

C:\Users\X360>pip3 install sklearn
Requirement already satisfied: sklearn in c:\users\x360\appdata\local\programs\python\python39\lib\site-packages (0.0)
Requirement already satisfied: scikit-learn in c:\users\x360\appdata\local\programs\python\python39\lib\site-packages (from sklearn) (0.24.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in c:\users\x360\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn->sklearn) (2.1.0)
Requirement already satisfied: scipy>=0.19.1 in c:\users\x360\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn->sklearn) (1.6.0)
Requirement already satisfied: joblib>=0.11 in c:\users\x360\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn->sklearn) (1.0.0)
Requirement already satisfied: numpy>=1.13.3 in c:\users\x360\appdata\local\programs\python\python39\lib\site-packages (from scikit-learn->sklearn) (1.19.3)
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'c:\users\x360\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip' command.

Upvotes: 1

Views: 646

Answers (1)

sekomer
sekomer

Reputation: 742

sklearn is the shortcut of scikit-learn. You should try:

pip install scikit-learn  

choose pip/pip3 depending to your working enviroment

See the docs for further information

Also there is a warning about your pip version, i suggest you to update your pip via

pip install --upgrade pip

Upvotes: 1

Related Questions