4
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.

Ravi Makwana
  • 2,782
  • 1
  • 29
  • 41
owais
  • 57
  • 1
  • 2

2 Answers2

1

Try installing scipy and restarting python shell

Chirag
  • 259
  • 1
  • 8
  • got similar query posted try https://stackoverflow.com/questions/15274696/importerror-in-importing-from-sklearn-cannot-import-name-check-build – Chirag Apr 13 '19 at 18:23
  • I had a python folder installed outside the Anaconda3 folder. I think there was a clash between libraries. I deleted that folder and this worked for me. Thanks for the answers – owais Apr 14 '19 at 10:35
0

Upgrading scikit-learn worked for me:

$ pip install --upgrade scikit-learn

Nix G-D
  • 757
  • 6
  • 8