4

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?

1 Answer 1

9

Sounds like you are missing the python development headers.

sudo apt-get install python2.7-dev

Change to the proper python version though

2
  • 1
    Thanks jdi! I emailed the creator to add this bit to the documentation.
    – Atif
    Feb 7, 2012 at 22:17
  • 1
    No prob. But that that is really specific to debian linux operating systems. It doesn't apply to everyone.
    – jdi
    Feb 7, 2012 at 23:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.