Ubuntu, cmemcache, and python-memcached (once again)

I wrote earlier about my not quite satisfactory attempt to install cmemcache on Ubuntu. After stumbling upon this exhaustive guide on how to set up a full-blown Django environment under Ubuntu I thought I’d try the apt-get route for libmemcache too. All you need to do to get libmemcache and the necessary header files installed is:

sudo apt-get install libmemcache-dev libmemcache0

After that, the steps for installing cmemcache itself are the same as before. The good news is that libmemcache and cmemcache both get installed without fuss using this approach, without any need for manual patching. The bad news is that the test.py suite still fails with same error message as before.

I cannot say that I fully understand the significance of this test failing. It might be harmless, but I sure like my tests to pass successfully so cmemcache will remain on my naughty list for now. Left with only python-memcached as a choice, I installed it instead, which was a breeze compared to cmemcache:

wget ftp://ftp.tummy.com/pub/python-memcached/python-memcached-1.43.tar.gz
tar xvfz python-memcached-1.43.tar.gz
cd python-memcached-1.43/
sudo apt-get install python-setuptools
sudo python setup.py install

python-setuptools is used by the setup.py script, so it needs to be installed before running the setup. Once done, you can test python-memcached almost identically to cmemcache earlier (memcached needs to run in the background on localhost for this to work):

>>> import memcache
>>> c = memcache.Client(['127.0.0.1:11211'])
>>> c.set('testkey', 'testval')
True
>>> c.get('testkey')
'testval'
>>>
Advertisements

4 responses to “Ubuntu, cmemcache, and python-memcached (once again)

  1. Thanks dude, you rock

  2. devdoodles

    You’re welcome. 😉 Nice to hear you found something useful!

  3. i feel your pain, i used the exact same “exhaustive guide”. it’s always a comfort to know i’m not the only one having issues. you just got a new subscriber.

  4. Pingback: Mathias' Blog » Memcached decorator for Python