ModuleNotFoundError: No module named 'sklearn'

ModuleNotFoundError: No module named 'sklearn'

Hi,

I am trying to use sklearn with Python machine learning program. My program gives following error:

python 1.py
Traceback (most recent call last):
  File "1.py", line 2, in <module>
    from sklearn.datasets import fetch_20newsgroups
ModuleNotFoundError: No module named 'sklearn'

How to install sklearn?

Thanks

View Answers

January 19, 2019 at 8:07 AM

Hi,

The sklearn is powerful machine learning library in Python. It provides a wide range of supervised and unsupervised learning algorithms.

You can install it with pip with following command:

pip install sklearn

Here is full sklearn installation process:

(tf12) deepak@deepak-VirtualBox:~/textgeneration$ pip install sklearn
Collecting sklearn
  Downloading https://files.pythonhosted.org/packages/1e/7a/dbb3be0ce9bd5c8b7e3d87328e79063f8b263b2b1bfa4774cb1147bfcd3f/sklearn-0.0.tar.gz
Collecting scikit-learn (from sklearn)
  Downloading https://files.pythonhosted.org/packages/0d/3a/b92670f5c368c20329ecc4c255993fae7934564d485c3ed7ea7b8da7f741/scikit_learn-0.20.2-cp36-cp36m-manylinux1_x86_64.whl (5.4MB)
    100% 5.4MB 780kB/s 
Requirement already satisfied: numpy>=1.8.2 in /home/deepak/anaconda3/envs/tf12/lib/python3.6/site-packages (from scikit-learn->sklearn) (1.16.0)
Collecting scipy>=0.13.3 (from scikit-learn->sklearn)
  Downloading https://files.pythonhosted.org/packages/67/e6/6d4edaceee6a110ecf6f318482f5229792f143e468b34a631f5a0899f56d/scipy-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (26.6MB)
    100% | 26.6MB 591kB/s 
Building wheels for collected packages: sklearn
  Running setup.py bdist_wheel for sklearn ... done
  Stored in directory: /home/deepak/.cache/pip/wheels/76/03/bb/589d421d27431bcd2c6da284d5f2286c8e3b2ea3cf1594c074
Successfully built sklearn
Installing collected packages: scipy, scikit-learn, sklearn
Successfully installed scikit-learn-0.20.2 scipy-1.2.0 sklearn-0.0

Thanks









Related Tutorials/Questions & Answers:
ModuleNotFoundError: No module named 'sklearn'
ModuleNotFoundError: No module named 'sklearn'  Hi, My Python... 'sklearn' How to remove the ModuleNotFoundError: No module named 'sklearn..., ModuleNotFoundError: No module named 'sklearn' error will be solved
ModuleNotFoundError: No module named 'sklearn'
ModuleNotFoundError: No module named 'sklearn'  Hi, My Python... 'sklearn' How to remove the ModuleNotFoundError: No module named 'sklearn..., ModuleNotFoundError: No module named 'sklearn' error will be solved
Advertisements
ModuleNotFoundError: No module named 'sklearn'
ModuleNotFoundError: No module named 'sklearn'  Hi, I am trying... error: ModuleNotFoundError: No module named 'sklearn' >>> >>...; ModuleNotFoundError: No module named 'sklearn' >>> How to resolve it? Thanks
ModuleNotFoundError: No module named 'sklearn'
ModuleNotFoundError: No module named 'sklearn'  Hi, I am trying... error: ModuleNotFoundError: No module named 'sklearn' >>> >>...; ModuleNotFoundError: No module named 'sklearn' >>> How to resolve it?ADS
ModuleNotFoundError: No module named 'sklearn'
ModuleNotFoundError: No module named 'sklearn'  Hi, I am trying to use sklearn with Python machine learning program. My program gives following... ModuleNotFoundError: No module named 'sklearn' How to install sklearn? Thanks   Hi
ModuleNotFoundError: No module named 'auto-sklearn'
ModuleNotFoundError: No module named 'auto-sklearn'  Hi, My Python... 'auto-sklearn' How to remove the ModuleNotFoundError: No module named '... of auto-sklearn python library, ModuleNotFoundError: No module named 'auto
ModuleNotFoundError: No module named 'nbsvm-sklearn'
ModuleNotFoundError: No module named 'nbsvm-sklearn'  Hi, My... 'nbsvm-sklearn' How to remove the ModuleNotFoundError: No module named... the installation of nbsvm-sklearn python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'neurocombat-sklearn'
ModuleNotFoundError: No module named 'neurocombat-sklearn'  Hi, My...: No module named 'neurocombat-sklearn' error? Thanks   Hi..., ModuleNotFoundError: No module named 'neurocombat-sklearn' error
ModuleNotFoundError: No module named 'sigopt-sklearn'
ModuleNotFoundError: No module named 'sigopt-sklearn'  Hi, My... named 'sigopt-sklearn' How to remove the ModuleNotFoundError: No module named... the installation of sigopt-sklearn python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-compiledtrees'
ModuleNotFoundError: No module named 'sklearn-compiledtrees'  Hi...: No module named 'sklearn-compiledtrees' How to remove the ModuleNotFoundError: No module named 'sklearn-compiledtrees' error? Thanks   Hi
ModuleNotFoundError: No module named 'sklearn-crfsuite'
ModuleNotFoundError: No module named 'sklearn-crfsuite'  Hi, My... named 'sklearn-crfsuite' How to remove the ModuleNotFoundError: No module...: No module named 'sklearn-crfsuite' error will be solved. Thanks
ModuleNotFoundError: No module named 'sklearn-deap'
ModuleNotFoundError: No module named 'sklearn-deap'  Hi, My Python... 'sklearn-deap' How to remove the ModuleNotFoundError: No module named '... of sklearn-deap python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-deltatfidf'
ModuleNotFoundError: No module named 'sklearn-deltatfidf'  Hi, My... named 'sklearn-deltatfidf' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-deltatfidf' error will be solved
ModuleNotFoundError: No module named 'sklearn-dummies'
ModuleNotFoundError: No module named 'sklearn-dummies'  Hi, My... named 'sklearn-dummies' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-dummies python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'sklearn-evaluation'
ModuleNotFoundError: No module named 'sklearn-evaluation'  Hi, My... named 'sklearn-evaluation' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-evaluation' error will be solved
ModuleNotFoundError: No module named 'sklearn-ex'
ModuleNotFoundError: No module named 'sklearn-ex'  Hi, My Python... 'sklearn-ex' How to remove the ModuleNotFoundError: No module named '...-ex python library, ModuleNotFoundError: No module named 'sklearn-ex'
ModuleNotFoundError: No module named 'sklearn-export'
ModuleNotFoundError: No module named 'sklearn-export'  Hi, My... named 'sklearn-export' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-export python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-extensions'
ModuleNotFoundError: No module named 'sklearn-extensions'  Hi, My... named 'sklearn-extensions' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-extensions' error will be solved
ModuleNotFoundError: No module named 'sklearn_extras'
ModuleNotFoundError: No module named 'sklearn_extras'  Hi, My... named 'sklearn_extras' How to remove the ModuleNotFoundError: No module named... the installation of sklearn_extras python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-features'
ModuleNotFoundError: No module named 'sklearn-features'  Hi, My... named 'sklearn-features' How to remove the ModuleNotFoundError: No module...: No module named 'sklearn-features' error will be solved. Thanks
ModuleNotFoundError: No module named 'sklearn-fuzzy'
ModuleNotFoundError: No module named 'sklearn-fuzzy'  Hi, My... 'sklearn-fuzzy' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-fuzzy python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-gbmi'
ModuleNotFoundError: No module named 'sklearn-gbmi'  Hi, My Python... 'sklearn-gbmi' How to remove the ModuleNotFoundError: No module named '... of sklearn-gbmi python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-genetic'
ModuleNotFoundError: No module named 'sklearn-genetic'  Hi, My... named 'sklearn-genetic' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-genetic python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'sklearn-glvq'
ModuleNotFoundError: No module named 'sklearn-glvq'  Hi, My Python... 'sklearn-glvq' How to remove the ModuleNotFoundError: No module named '... of sklearn-glvq python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-json'
ModuleNotFoundError: No module named 'sklearn-json'  Hi, My Python... 'sklearn-json' How to remove the ModuleNotFoundError: No module named '... of sklearn-json python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-lmer'
ModuleNotFoundError: No module named 'sklearn-lmer'  Hi, My Python... 'sklearn-lmer' How to remove the ModuleNotFoundError: No module named '... of sklearn-lmer python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-lvq'
ModuleNotFoundError: No module named 'sklearn-lvq'  Hi, My Python... 'sklearn-lvq' How to remove the ModuleNotFoundError: No module named '... of sklearn-lvq python library, ModuleNotFoundError: No module named 'sklearn-lvq
ModuleNotFoundError: No module named 'sklearn-pandas'
ModuleNotFoundError: No module named 'sklearn-pandas'  Hi, My... named 'sklearn-pandas' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-pandas python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-plus'
ModuleNotFoundError: No module named 'sklearn-plus'  Hi, My Python... 'sklearn-plus' How to remove the ModuleNotFoundError: No module named '... of sklearn-plus python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-pmml'
ModuleNotFoundError: No module named 'sklearn-pmml'  Hi, My Python... 'sklearn-pmml' How to remove the ModuleNotFoundError: No module named '... of sklearn-pmml python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-porter'
ModuleNotFoundError: No module named 'sklearn-porter'  Hi, My... named 'sklearn-porter' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-porter python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-pycrfsuite'
ModuleNotFoundError: No module named 'sklearn-pycrfsuite'  Hi, My... named 'sklearn-pycrfsuite' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-pycrfsuite' error will be solved
ModuleNotFoundError: No module named 'sklearn-recommender'
ModuleNotFoundError: No module named 'sklearn-recommender'  Hi, My...: No module named 'sklearn-recommender' error? Thanks   Hi..., ModuleNotFoundError: No module named 'sklearn-recommender' error
ModuleNotFoundError: No module named 'sklearn-template'
ModuleNotFoundError: No module named 'sklearn-template'  Hi, My... named 'sklearn-template' How to remove the ModuleNotFoundError: No module...: No module named 'sklearn-template' error will be solved. Thanks
ModuleNotFoundError: No module named 'sklearn-to-pfa'
ModuleNotFoundError: No module named 'sklearn-to-pfa'  Hi, My... named 'sklearn-to-pfa' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-to-pfa python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn_utils'
ModuleNotFoundError: No module named 'sklearn_utils'  Hi, My... 'sklearn_utils' How to remove the ModuleNotFoundError: No module named... the installation of sklearn_utils python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-xarray'
ModuleNotFoundError: No module named 'sklearn-xarray'  Hi, My... named 'sklearn-xarray' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-xarray python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-compiledtrees'
ModuleNotFoundError: No module named 'sklearn-compiledtrees'  Hi...: No module named 'sklearn-compiledtrees' How to remove the ModuleNotFoundError: No module named 'sklearn-compiledtrees' error? Thanks   Hi
ModuleNotFoundError: No module named 'sklearn-crfsuite'
ModuleNotFoundError: No module named 'sklearn-crfsuite'  Hi, My... named 'sklearn-crfsuite' How to remove the ModuleNotFoundError: No module...: No module named 'sklearn-crfsuite' error will be solved. Thanks
ModuleNotFoundError: No module named 'sklearn-deap'
ModuleNotFoundError: No module named 'sklearn-deap'  Hi, My Python... 'sklearn-deap' How to remove the ModuleNotFoundError: No module named '... of sklearn-deap python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-deltatfidf'
ModuleNotFoundError: No module named 'sklearn-deltatfidf'  Hi, My... named 'sklearn-deltatfidf' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-deltatfidf' error will be solved
ModuleNotFoundError: No module named 'sklearn-dummies'
ModuleNotFoundError: No module named 'sklearn-dummies'  Hi, My... named 'sklearn-dummies' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-dummies python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'sklearn-evaluation'
ModuleNotFoundError: No module named 'sklearn-evaluation'  Hi, My... named 'sklearn-evaluation' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-evaluation' error will be solved
ModuleNotFoundError: No module named 'sklearn-ex'
ModuleNotFoundError: No module named 'sklearn-ex'  Hi, My Python... 'sklearn-ex' How to remove the ModuleNotFoundError: No module named '...-ex python library, ModuleNotFoundError: No module named 'sklearn-ex'
ModuleNotFoundError: No module named 'sklearn-export'
ModuleNotFoundError: No module named 'sklearn-export'  Hi, My... named 'sklearn-export' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-export python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-extensions'
ModuleNotFoundError: No module named 'sklearn-extensions'  Hi, My... named 'sklearn-extensions' How to remove the ModuleNotFoundError: No module..., ModuleNotFoundError: No module named 'sklearn-extensions' error will be solved
ModuleNotFoundError: No module named 'sklearn_extras'
ModuleNotFoundError: No module named 'sklearn_extras'  Hi, My... named 'sklearn_extras' How to remove the ModuleNotFoundError: No module named... the installation of sklearn_extras python library, ModuleNotFoundError: No module named
ModuleNotFoundError: No module named 'sklearn-features'
ModuleNotFoundError: No module named 'sklearn-features'  Hi, My... named 'sklearn-features' How to remove the ModuleNotFoundError: No module...: No module named 'sklearn-features' error will be solved. Thanks
ModuleNotFoundError: No module named 'sklearn-fuzzy'
ModuleNotFoundError: No module named 'sklearn-fuzzy'  Hi, My... 'sklearn-fuzzy' How to remove the ModuleNotFoundError: No module named... the installation of sklearn-fuzzy python library, ModuleNotFoundError: No module named '
ModuleNotFoundError: No module named 'sklearn-gbmi'
ModuleNotFoundError: No module named 'sklearn-gbmi'  Hi, My Python... 'sklearn-gbmi' How to remove the ModuleNotFoundError: No module named '... of sklearn-gbmi python library, ModuleNotFoundError: No module named '

Ads