How to install pylibmc (python client for memcached)?

I am 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 am running Ubuntu 10.04 and I also tried installing it on a Debian Lenny virtual machine.

This is the error I get:

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 he says: _pylibmcmodule.h: 41: 20: error: Python.h: There is no such file or directory

What am I doing wrong?

+4
source share
1 answer

It looks like you are missing the python development headers.

 sudo apt-get install python2.7-dev 

Change the correct version of python though

+7
source

Source: https://habr.com/ru/post/1393075/


All Articles