坑爹的pylibmc官方安装文档

上午才说过redis4you挂掉了,为了保险准备给vps安装memcached支持,最开始准备简单安装python-memcached,简单的easy_install python-memcached即可,但是在windows机器上下载了python-memcache代码发现这个是纯python实现的,而且看到SAE使用了pylibmc来做python的memcache库。

easy_install -m python-memcached卸载python-memcached(还需要rm /usr/local/python/lib/python2.7/site-packages/python_memcached-1.48-py2.7.egg)后找到pylibmc的安装文档。然后按照文档安装,安装完后import pylibmc却提示「ImportError: libmemcached.so.11: cannot open shared object file: No such file or directory

安装时候已经按照提示「echo "/usr/local/libmemcached/lib/" >> /etc/ld.so.conf」将so目录添加到了ld.so.conf中……

并且安装pylibmc时候也是已经指定了libmemcached的安装目录「python setup.py install --with-libmemcached=/usr/local/libmemcached」

最后不得已手动创建「ln -s /usr/local/libmemcached/lib/libmemcached.so.11 /usr/lib/libmemcached.so.11」

添加新评论 »