pythonmemcachedpython-memcached

How to install pylibmc (python client for memcached)?


I'm trying to install pylibmc according to the instructions here: http://sendapatch.se/projects/pylibmc/install.html

I downloaded the latest version of pylibmc from here: http://pypi.python.org/pypi/pylibmc

I downloaded libmemcached (0.51) from here: http://launchpad.net/libmemcached/1.0/0.51/+download/libmemcached-0.51.tar.gz

I'm running Ubuntu 10.04, and I also tried installing it on a Debian Lenny VM.

This is the error I'm getting:

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

I don't know why it says: _pylibmcmodule.h:41:20: error: Python.h: No such file or directory

What am I doing wrong?


Solution

  • Sounds like you are missing the python development headers.

    sudo apt-get install python2.7-dev
    

    Change to the proper python version though