Ber*_*uan 5 python macos numpy
我的操作系统是OSX 10.10.4,我有python2.7.10和python3.5,并尝试为这两个版本的python安装numpy,scipy和matplotlib.
在python2中它运行良好,但对于python3,我尝试使用命令安装numpy
pip3 install numpy
Run Code Online (Sandbox Code Playgroud)
然后事实证明安装终止,因为它找不到文件Python.h但实际上文件python.h确实存在于python3.5的目录中.所以我现在很困惑.
更新18月9日,确切的错误消息:最初它尝试构建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
Run Code Online (Sandbox Code Playgroud)
然后安装报告了同样的错误.