1. 程式人生 > >解決ImportError: numpy.core.multiarray failed to import

解決ImportError: numpy.core.multiarray failed to import

When I ran into this, it was because I had another version of numpy
installed on my machine in a different location – I had to uninstall
the other (older) version.

一般的解決辦法:

pip install -U numpy

也有這樣解決的:

$ import numpy as np
$ np.version
'1.8.0rc1'
$ np.path
['/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy']
$ exit()

$ sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
delete older version 1.8.0rc1,newer version 1.11.2 will be used