Worked for me after installing scipy.
>>> from sklearn import preprocessing, metrics, cross_validation
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
from sklearn import preprocessing, metrics, cross_validation
File "D:\Python27\lib\site-packages\sklearn\__init__.py", line 31, in <module>
from . import __check_build
ImportError: cannot import name __check_build
>>> ================================ RESTART ================================
>>> from sklearn import preprocessing, metrics, cross_validation
>>>
So, simply try to restart the shell!
My solution for Python 3.6.5 64-bit Windows 10:
pip uninstall sklearn
pip uninstall scikit-learn
pip install sklearn
No need to restart command-line but you can do this if you want. It took me one day to fix this bug. Hope this help.
After installing numpy
, scipy
,sklearn
still has error
Solution:
Setting Up System Path
Variable for Python & the PYTHONPATH
Environment Variable
System Variables: add C:\Python34
into path
User Variables: add new: (name)PYTHONPATH
(value)C:\Python34\Lib\site-packages;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With