My operating system is OSX 10.10.4 and I have both python2.7.10 and python3.5 and tried to install numpy, scipy and matplotlib for both this two versions of python.
In python2 it went well but as for python3, I tried to install numpy with command
pip3 install numpy
Then it turned out that the installation terminated because of it cannot find file Python.h But in fact the file python.h does exist in python3.5's directory. So I am quite confused now.
Update 18 Sept, the exact error messages: initially it tried to build numpy:
compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -c'
clang: _configtest.c
_configtest.c:1:10: fatal error: 'Python.h' file not found
#include <Python.h>
^
1 error generated.
_configtest.c:1:10: fatal error: 'Python.h' file not found
#include <Python.h>
^
1 error generated.
failure.
removing: _configtest.c _configtest.o
Running from numpy source directory.
/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
.....
File "numpy/core/setup.py", line 293, in check_types
"Cannot compile 'Python.h'. Perhaps you need to "\
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
----------------------------------------
Failed building wheel for numpy
Failed to build numpy
and then the installation reported the same error.
According to this page this is fixed in version 1.9.3 of numpy. Try
pip3 install numpy==1.9.3
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