Error while installing python client for Aerospike


#1

I am trying to install aerospike python client on ubuntu 14.04 but getting this error while running “pip install aerospike”

I have installed all the packages as mentioned on page along with python-dev package. Please assist in the same.

CHECK

[✓] /usr/lib/libaerospike.a

[✓] /usr/include/aerospike/aerospike.h

[✓] /opt/aerospike/client/sys/udf/lua/aerospike.lua

info: Executing ./scripts/aerospike-client-c.sh

info: aerospike.h found: ./aerospike-client-c/include/aerospike/aerospike.h

info: libaerospike.a found: ./aerospike-client-c/lib/libaerospike.a

running install

running build

running build_ext

building ‘aerospike’ extension

creating build

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/src

creating build/temp.linux-x86_64-2.7/src/main

creating build/temp.linux-x86_64-2.7/src/main/client

creating build/temp.linux-x86_64-2.7/src/main/key

creating build/temp.linux-x86_64-2.7/src/main/query

creating build/temp.linux-x86_64-2.7/src/main/scan

creating build/temp.linux-x86_64-2.7/src/main/lstack

creating build/temp.linux-x86_64-2.7/src/main/lset

creating build/temp.linux-x86_64-2.7/src/main/llist

creating build/temp.linux-x86_64-2.7/src/main/lmap

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./aerospike-client-c/include -I./aerospike-client-c/include/ck -Isrc/include -I/usr/include/python2.7 -c src/main/aerospike.c -o build/temp.linux-x86_64-2.7/src/main/aerospike.o -std=gnu99 -g -Wall -fPIC -O1 -fno-common -fno-strict-aliasing -march=nocona -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -rdynamic -finline-functions -DMARCH_x86_64

In file included from ./aerospike-client-c/include/aerospike/as_query.h:23:0,

             from src/include/types.h:24,

             from src/include/client.h:21,

             from src/main/aerospike.c:22:

./aerospike-client-c/include/aerospike/as_udf.h:251:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

as_udf_file * as_udf_file_new();

^

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I./aerospike-client-c/include -I./aerospike-client-c/include/ck -Isrc/include -I/usr/include/python2.7 -c src/main/exception.c -o build/temp.linux-x86_64-2.7/src/main/exception.o -std=gnu99 -g -Wall -fPIC -O1 -fno-common -fno-strict-aliasing -march=nocona -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -rdynamic -finline-functions -DMARCH_x86_64

In file included from ./aerospike-client-c/include/aerospike/as_query.h:23:0,

             from src/main/exception.c:18:

./aerospike-client-c/include/aerospike/as_udf.h:251:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]

as_udf_file * as_udf_file_new();

^

In file included from src/main/exception.c:22:0:

src/include/conversions.h:38:46: error: unknown type name ‘as_user’

as_status as_user_to_pyobject(as_error *err, as_user *user, PyObject **py_as_user);

                                          ^

src/include/conversions.h:40:52: error: unknown type name ‘as_user’

as_status as_user_array_to_pyobject(as_error *err, as_user **users, PyObject **py_as_users, int users_size);

                                                ^

In file included from src/main/exception.c:22:0:

src/include/conversions.h:78:53: error: unknown type name ‘as_privilege’

as_status as_privilege_to_pyobject( as_error * err, as_privilege privileges[], PyObject ** py_as_privilege, int privilege_size);

                                                 ^

src/include/conversions.h:80:48: error: unknown type name ‘as_role’

as_status as_role_to_pyobject( as_error * err, as_role * role, PyObject ** py_as_role );

                                            ^

src/include/conversions.h:82:53: error: unknown type name ‘as_role’

as_status as_role_array_to_pyobject( as_error *err, as_role **roles, PyObject **py_as_roles, int roles_size );

                                                 ^

src/include/conversions.h:84:72: error: unknown type name ‘as_privilege’

void pyobject_to_as_privileges(as_error err, PyObject py_privileges, as_privilege privileges, int privileges_size);

                                                                    ^

src/main/exception.c: In function ‘AerospikeException_New’:

src/main/exception.c:45:4: error: ‘AEROSPIKE_ERR_FAIL_FORBIDDEN’ undeclared (first use in this function)

AEROSPIKE_ERR_FAIL_FORBIDDEN, AEROSPIKE_ERR_QUERY, AEROSPIKE_ERR_CLUSTER}

^

src/main/exception.c:45:4: note: each undeclared identifier is reported only once for each function it appears in

src/main/exception.c:83:28: error: ‘AEROSPIKE_ROLE_ALREADY_EXISTS’ undeclared (first use in this function)

AEROSPIKE_INVALID_ROLE, AEROSPIKE_ROLE_ALREADY_EXISTS, AEROSPIKE_ROLE_VIOLATION,

                        ^

src/main/exception.c:168:27: error: ‘AEROSPIKE_ERR_INVALID_HOST’ undeclared (first use in this function)

py_code = PyInt_FromLong(AEROSPIKE_ERR_INVALID_HOST);

                       ^

error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1


Cleaning up… Command /usr/bin/python -c “import setuptools, tokenize;file=’/tmp/pip_build_root/aerospike/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(’\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-0VKYXe-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/aerospike Traceback (most recent call last): File “/usr/bin/pip”, line 9, in load_entry_point(‘pip==1.5.4’, ‘console_scripts’, ‘pip’)() File “/usr/lib/python2.7/dist-packages/pip/init.py”, line 235, in main return command.main(cmd_args) File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 161, in main text = ‘\n’.join(complete_log) UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe2 in position 8: ordinal not in range(128)


#2

Hi Amit. Please see this pinned topic:

In general, please provide the version of Python and which release of the Python client for Aerospike you’re seeing this with.


#3

Thanks I have opened an issue on github.com

I am using python 2.7.6


#4

Please verify if release >= 1.0.46 fixes your problem.