我尝试使用scipy.weave
用于数值优化的包,并在调用中遇到 CompileError scipy.weave.inline
。
一些实验带来了一个最小的失败示例:
import scipy.weave
scipy.weave.inline('printf("%d\\n",1);')
这导致我出于空间原因将大量错误转储放在 pastebin 上:http: //pastebin.com/0QR4kq2V
转储中的第一个错误是
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/complex:47:28: error: bits/c++config.h: No such file or directory
最后的输出是
CompileError: error: Command "g++ -fno-strict-aliasing -fno-common -dynamic -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/scipy/weave -I/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/scipy/weave/scxx -I/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/7.3/include/python2.7 -c /Users/mik/.python27_compiled/sc_f6039f30c0a12f4687924b6a12ef83730.cpp -o /var/folders/_z/qd8rt65n1n56_nvv4nyy7xlh0000gn/T/mik/python27_intermediate/compiler_ecdbc4f3f030692747d93319f8d429b2/Users/mik/.python27_compiled/sc_f6039f30c0a12f4687924b6a12ef83730.o" failed with exit status 1
我运行 MacOSX 10.8.4,
> g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
和
> python --version
Python 2.7.3 -- EPD 7.3-2 (32-bit)