ModuleNotFoundError: No module named 'sklearn'

Ads
 

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) [email protected]:~/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

Ads









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? Thanks
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 'easy-sklearn'
ModuleNotFoundError: No module named 'easy-sklearn'  Hi, My Python... 'easy-sklearn' How to remove the ModuleNotFoundError: No module named '... of easy-sklearn python library, ModuleNotFoundError: No module named 'easy
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-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-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-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-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-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-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-rvm'
ModuleNotFoundError: No module named 'sklearn-rvm'  Hi, My Python... 'sklearn-rvm' How to remove the ModuleNotFoundError: No module named '... of sklearn-rvm python library, ModuleNotFoundError: No module named 'sklearn-rvm
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 '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 'chainer_sklearn'
ModuleNotFoundError: No module named 'chainer_sklearn'  Hi, My... named 'chainer_sklearn' How to remove the ModuleNotFoundError: No module named... the installation of chainer_sklearn python library, ModuleNotFoundError: No module
ModuleNotFoundError: No module named 'explain_sklearn'
ModuleNotFoundError: No module named 'explain_sklearn'  Hi, My... named 'explain_sklearn' How to remove the ModuleNotFoundError: No module named... the installation of explain_sklearn python library, ModuleNotFoundError: No module
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 '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_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 '

Ads