如何安装pylibmc(用于memcached的python客户端)



我正试图根据此处的说明安装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/+下载/libmemocached-0.51.tar.gz

我运行的是Ubuntu 10.04,我也试着在Debian Lenny虚拟机上安装它。

这是我得到的错误:

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

我不知道为什么它说:_pylibmmodule.h:41:20:error:Python.h:没有这样的文件或目录

我做错了什么?

听起来好像缺少python开发头。

sudo apt-get install python2.7-dev

通过

更改为正确的python版本

相关内容

  • 没有找到相关文章

最新更新