owais
owais

Reputation: 57

ImportError: No module named 'sklearn.__check_build._check_build'

ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in <module>()

     43 try:
---> 44     from ._check_build import check_build  # noqa
     45 except ImportError as e:

ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-f14d678f34eb> in <module>()



      1 from keras.models import Sequential
      2 from keras.layers import Dense, Dropout
----> 3 from sklearn.model_selection import train_test_split
      4 import numpy
      5 import pandas as pd

~\AppData\Roaming\Python\Python36\site-packages\sklearn\__init__.py in <module>()
     61     # process, as it may not be compiled yet
     62 else:
---> 63     from . import __check_build
     64     from .base import clone
     65     from .utils._show_versions import show_versions

~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in <module>()
     44     from ._check_build import check_build  # noqa
     45 except ImportError as e:
---> 46     raise_build_error(e)

~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in raise_build_error(e)
     39 to build the package before using it: run `python setup.py install` or
     40 `make` in the source directory.
---> 41 %s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
     42 
     43 try:

ImportError: No module named 'sklearn.__check_build._check_build'


Contents of C:\Users\owaisaaa\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build:
setup.py                  _check_build.cp36-win32.pyd__init__.py
__pycache__

It seems that scikit-learn has not been built correctly.

If you have installed scikit-learn from source, please do not forget to build the package before using it: run python setup.py install or make in the source directory.

If you have used an installer, please check that it is suited for your Python version, your operating system and your platform.

I recently used the pycharm on the same machine and downloaded the packages in it. From that moment onward I am getting the above mentioned error in my jupyter notebook.

Upvotes: 4

Views: 8096

Answers (2)

Nix G-D
Nix G-D

Reputation: 787

Upgrading scikit-learn worked for me:

$ pip install --upgrade scikit-learn

Upvotes: 0

Chirag
Chirag

Reputation: 259

Try installing scipy and restarting python shell

Upvotes: 1

Related Questions