尝试在一个运行Ubuntu Server的小型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, Apr 16 2010, 13:57:41)。谢谢!
python-devel
。可能需要知道操作系统所需的Python版本。 - Oluwatobi Samuel Omisakin