1、由于早期用python3.4研究pandas时,顺便安装了numpy,当时安装的是numpy 1.12.0rc2+mkl,而这次我打算自己研究sklearn程序,发现安装了sklearn '0.19.2'后,import sklearn 异常
D:\Python34\Scripts>python
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
Traceback (most recent call last):
File "__init__.pxd", line 998, in numpy.import_array
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python34\lib\site-packages\sklearn\__init__.py", line 134, in <module>
from .base import clone
File "D:\Python34\lib\site-packages\sklearn\base.py", line 13, in <module>
from .utils.fixes import signature
File "D:\Python34\lib\site-packages\sklearn\utils\__init__.py", line 9, in <module>
from .murmurhash import murmurhash3_32
File "sklearn\utils\murmurhash.pyx", line 26, in init sklearn.utils.murmurhash
File "__init__.pxd", line 1000, in numpy.import_array
ImportError: numpy.core.multiarray failed to import
>>> import scipy
>>> import numpy
>>> import sklearn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Python34\lib\site-packages\sklearn\__init__.py", line 133, in <module>
from . import __check_build
ImportError: cannot import name '__check_build'
经定位是numpy+mkl版本太低了需要安装numpy-1.14.5+mkl-cp34-cp34m-win32