# Python client error when doing import

**URL:** <https://discuss.aerospike.com/t/python-client-error-when-doing-import/924>\
**Category:** Client Libraries\
**Created:** [February 7, 2015, 2:13am UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924 "2015-02-07T02:13:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![isingh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/isingh/32/145_2.png) [@isingh](https://discuss.aerospike.com/u/isingh)\
**Post date:** [February 7, 2015, 2:13am UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924/1 "2015-02-07T02:13:15Z")

</div>

Hi

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/aerospike.so, 2): Symbol not found: \_luaL\_loadbuffer Referenced from: /Library/Python/2.7/site-packages/aerospike.so Expected in: flat namespace in /Library/Python/2.7/site-packages/aerospike.so

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

Any ideas?

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [February 9, 2015, 9:25pm UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924/2 "2015-02-09T21:25:26Z")

</div>

Hi,

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

For example:

```auto
$ 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.

---

<div class="post-metadata">

**Author:** ![isingh](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/isingh/32/145_2.png) [@isingh](https://discuss.aerospike.com/u/isingh)\
**Post date:** [February 9, 2015, 10:45pm UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924/3 "2015-02-09T22:45:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scompto](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@scompto](https://discuss.aerospike.com/u/scompto)\
**Post date:** [February 12, 2015, 10:44pm UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924/4 "2015-02-12T22:44:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![scompto](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@scompto](https://discuss.aerospike.com/u/scompto)\
**Post date:** [February 12, 2015, 10:50pm UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924/5 "2015-02-12T22:50:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [February 17, 2015, 1:59am UTC](https://discuss.aerospike.com/t/python-client-error-when-doing-import/924/6 "2015-02-17T01:59:39Z")

</div>

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.
