I tried to import sklearn and got the following error:
In [1]: import sklearn
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 2))
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-8fd979e02004> in <module>()
----> 1 import sklearn
c:\Python27\lib\site-packages\sklearn\__init__.py in <module>()
29 # process, as it may not be compiled yet
30 else:
---> 31 from . import __check_build
32 from .base import clone
33
c:\Python27\lib\site-packages\sklearn\__check_build\__init__.py in <module>()
44 from ._check_build import check_build
45 except ImportError as e:
---> 46 raise_build_error(e)
c:\Python27\lib\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 _check_build
___________________________________________________________________________
Contents of c:\Python27\lib\site-packages\sklearn\__check_build:
setup.py __init__.py __init__.pyc
___________________________________________________________________________
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'm running Windows 8 with Python (x, y) 2.7.6.1. It is weird because I could use sklearn previously (actually, I got this error trying to run a script I had written and tested on this computer).
I checked that sklearn has a module named __check_build whose __init__.py file has the following line:
from ._check_build import check_build
And indeed there is no _check_build in my installation.
Any help is appreciated.