我想在Python中使用Twisted,但当我安装时,出现了这个错误,该如何处理?
....
running build_ext
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c conftest.c -o conftest.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c conftest.c -o conftest.o
building 'twisted.runner.portmap' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c twisted/runner/portmap.c -o build/temp.linux-i686-2.7/twisted/runner/portmap.o
twisted/runner/portmap.c:10:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1发布于 2012-07-16 00:36:50
您缺少构建需要编译扩展的包所需的python开发头文件。
如果您在OSX上构建,请确保您安装了一个预构建的mac python包,或者如果从源代码构建python,请在配置时使用framework标志。还要确保你安装了XCODE,这样你就有了一个编译器。
如果您在Linux上构建,则可能需要安装python devel头文件。例如,在Ubuntu上,你需要:apt-get install build-essential python-dev。一旦您有了python开发头文件,当您使用python解释器构建时,twisted应该能够找到它们。
https://stackoverflow.com/questions/11493644
复制相似问题