python - Error with pylibmc on Mac OS Lion -


i have problem pylibmc on mac os lion.

libmemcached — 1.0.4

pylibmc — 1.2.3

$ python python 2.7.1 (r271:86832, jun 25 2011, 05:09:01)  [gcc 4.2.1 (based on apple inc. build 5658) (llvm build 2335.15.00)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import pylibmc traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "/library/python/2.7/site-packages/pylibmc/__init__.py", line 70, in <module>     import _pylibmc importerror: dlopen(/library/python/2.7/site-packages/_pylibmc.so, 2): symbol not found: _memcached_add   referenced from: /library/python/2.7/site-packages/_pylibmc.so   expected in: flat namespace  in /library/python/2.7/site-packages/_pylibmc.so 

but works sudo!

$ sudo python password: python 2.7.1 (r271:86832, jun 25 2011, 05:09:01)  [gcc 4.2.1 (based on apple inc. build 5658) (llvm build 2335.15.00)] on darwin type "help", "copyright", "credits" or "license" more information. >>> import pylibmc >>>  

any ideas?

installation in 32-bit mode solved problem.

  1. you need install libevent in 32-bit mode

    brew install --universal libevent 
  2. next download libmemcached source (1.0.8 version works me) , configure force 32 bit arch:

    ./configure --build=i386-apple-darwin11.4.2 "cflags=-m32" "cxxflags=-m32" "ldflags=-m32" make sudo make install 

    where 11.4.2 version of kernel

  3. reinstall pylibmc

    sudo pip uninstall pylibmc sudo pip install pylibmc 
  4. now works

    $ python -c 'import pylibmc' $ 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -