Python client error when doing import



I was trying to use the Python client library.

I am on a Macbook, Yosemite with lua51 installed via brew. I did pip install. However I cant get the client to load.

import aerospike Traceback (most recent call last): File “”, line 1, in ImportError: dlopen(/Library/Python/2.7/site-packages/, 2): Symbol not found: _luaL_loadbuffer Referenced from: /Library/Python/2.7/site-packages/ Expected in: flat namespace in /Library/Python/2.7/site-packages/

I get the above error, when I try to do an import aerospike in the python console/script.

Any ideas?



I’ve had to manually link to the brew ‘cellar’, because that wasn’t in the library path. Try use ln -s

For example:

$ ls -lh /usr/local/lib/|grep lua
lrwxr-xr-x   1 rbotzer  admin    42B Sep  5 16:01 liblua.5.1.5.dylib -> ../Cellar/lua/5.1.5/lib/liblua.5.1.5.dylib
lrwxr-xr-x   1 rbotzer  admin    40B Sep  5 16:01 liblua.5.1.dylib -> ../Cellar/lua/5.1.5/lib/liblua.5.1.dylib
-rw-r--r--+  1 root     admin   298K Jun 18  2014 liblua.a
lrwxr-xr-x   1 rbotzer  admin    36B Sep  5 16:01 liblua.dylib -> ../Cellar/lua/5.1.5/lib/liblua.dylib

Then call pip install once more.

Let me know if that works.


Thanks! My cellar is already linked.

$ ls -lh /usr/local/lib/|grep lua                                                         [ruby-2.0.0p481]
lrwxr-xr-x   1 inderpreetsingh  admin    44B Feb  6 17:57 liblua.5.1.5.dylib -> ../Cellar/lua51/5.1.5/lib/liblua.5.1.5.dylib
lrwxr-xr-x   1 inderpreetsingh  admin    42B Feb  6 17:57 liblua.5.1.dylib -> ../Cellar/lua51/5.1.5/lib/liblua.5.1.dylib
lrwxr-xr-x   1 inderpreetsingh  admin    44B Feb  4 17:24 liblua.5.2.3.dylib -> ../Cellar/lua/5.2.3_1/lib/liblua.5.2.3.dylib
lrwxr-xr-x   1 inderpreetsingh  admin    42B Feb  4 17:24 liblua.5.2.dylib -> ../Cellar/lua/5.2.3_1/lib/liblua.5.2.dylib
lrwxr-xr-x   1 inderpreetsingh  admin    38B Feb  4 17:24 liblua.dylib -> ../Cellar/lua/5.2.3_1/lib/liblua.dylib
lrwxr-xr-x   1 inderpreetsingh  admin    41B Feb  6 17:57 liblua5.1.dylib -> ../Cellar/lua51/5.1.5/lib/liblua5.1.dylib

It seems to me that I do not have the .a file. I got this working on CentOS, but cant get it to work on the Mac.


I am having the same issue. I have installed Lua via Brew, and Pip for Aerospike. Everything installed properly but I run into the error when trying to import the library in python. I am thinking that it could be the Lua version since i noticed brew grabbed 5.2.3


I have just confirmed that this was the case. Remove Lua using brew and manually grab and compile it using the instructions on the aerospike installation page, then just reinstall aerospike with pip.


Just a note, the dependency on a Lua prerequisite will be removed in the next release of the Python client. The necessary module will be bundled with the C client.