Cython安装GCC错误
尝试在运行 Ubuntu 服务器的小型 VPS 上安装 Cython。做了
sudo apt-get install gcc
然后
python setup.py install
在 Cython 目录中,但我得到了这个奇怪的错误。
running install
running build
running build_py
running build_ext
building 'Cython.Plex.Scanners' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c Cython/Plex/Scanners.c -o build/temp.linux-x86_64-2.6/Cython/Plex/Scanners.o
Cython/Plex/Scanners.c:4:20: error: Python.h: No such file or directory
Cython/Plex/Scanners.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python.
error: command 'gcc' failed with exit status 1
为什么我需要“Python 开发版本”?运行 Python 2.6.5(r265:79063,2010 年 4 月 16 日,13:57:41)。谢谢!
Trying to install Cython on a small VPS running Ubuntu Server. Did
sudo apt-get install gcc
and then
python setup.py install
In the Cython directory, but I get this peculiar error.
running install
running build
running build_py
running build_ext
building 'Cython.Plex.Scanners' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c Cython/Plex/Scanners.c -o build/temp.linux-x86_64-2.6/Cython/Plex/Scanners.o
Cython/Plex/Scanners.c:4:20: error: Python.h: No such file or directory
Cython/Plex/Scanners.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python.
error: command 'gcc' failed with exit status 1
Why should I need a 'development version of Python'? Running Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41). Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要 Python 的开发人员版本 - 即 Python 头文件 (Python.h)
You need the developer version of Python - i.e. the Python header files (Python.h)
您需要Python 开发版本中包含的标头,即
python.h
。它应该在 Ubuntu 中打包为python-dev
。You need the headers included in the development version of Python, i.e.
python.h
. It should be packaged in Ubuntu aspython-dev
.