I'm on a Mac, and I installed numpy
and sklearn
in that order. Now, I'm faced with these errors that have already been mentioned on SO several times:
sklearn "numpy.dtype has the wrong size, try recompiling" in both pycharm and terminal
ValueError: numpy.dtype has the wrong size, try recompiling
ImportError in importing from sklearn: cannot import name check_build
So, I try to remediate this error by uninstalling numpy
, and reinstalling a previous version.
1) sudo pip install --upgrade numpy
..gives permission error
...OSError: [Errno 1] Operation not permitted: '/tmp/pip-OVY0Vq-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'...
2) I tried brew uninstall numpy
, but import numpy
still works even after a shell restart.
The only thing left I can think of is to manually delete all of the numpy
files, which, on a Mac seeem to be found under
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
....but even that gives me a permission error. what gives?
I guess you are using MAC OS. I did a workaround to ignore the existing version of numpy (which MAC won't let you uninstall), and install an upgraded version.
Command :
pip install --upgrade --ignore-installed --install-option '--install-data=/usr/local' numpy
Worked fine for me.
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