4

我正在尝试根据此处的说明安装 pylibmc:http: //sendapatch.se/projects/pylibmc/install.html

我从这里下载了最新版本的 pylibmc:http: //pypi.python.org/pypi/pylibmc

我从这里下载了 libmemcached (0.51):http: //launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz

我正在运行 Ubuntu 10.04,我还尝试在 Debian Lenny VM 上安装它。

这是我得到的错误:

atif@atif-laptop:~/pylibmc-1.2.2$ python setup.py install --with-libmemcached=/home/atif/libmemcached-0.51
running install
running build
running build_py
running build_ext
building '_pylibmc' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/home/atif/libmemcached-0.51/include -I/usr/include/python2.6 -c _pylibmcmodule.c -o build/temp.linux-i686-2.6/_pylibmcmodule.o -fno-strict-aliasing
In file included from _pylibmcmodule.c:34:
_pylibmcmodule.h:41:20: error: Python.h: No such file or directory
In file included from _pylibmcmodule.c:34:
_pylibmcmodule.h:85: error: expected specifier-qualifier-list before ‘PyObject’
_pylibmcmodule.h:103: error: expected specifier-qualifier-list before ‘PyObject’
_pylibmcmodule.h:111: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token

我不知道为什么它说:_pylibmcmodule.h:41:20: error: Python.h: No such file or directory

我究竟做错了什么?

4

1 回答 1

9

听起来您缺少 python 开发标头。

sudo apt-get install python2.7-dev

更改为正确的python版本

于 2012-01-26T02:23:30.177 回答