# Error while installing python client for Aerospike

**URL:** <https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336>\
**Category:** Python Client\
**Created:** [June 2, 2015, 11:05am UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336 "2015-06-02T11:05:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Amit](https://discuss.aerospike.com/u/Amit)\
**Post date:** [June 2, 2015, 11:05am UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336/1 "2015-06-02T11:05:40Z")

</div>

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)

---

<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:** [June 2, 2015, 4:55pm UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336/2 "2015-06-02T16:55:25Z")

</div>

Hi Amit. Please see this pinned topic:

> [@Errors installing the Python client](https://discuss.aerospike.com/t/errors-installing-the-python-client/1337):
>
> If you run into problems installing the Python client with pip, please create a new [issue](https://github.com/aerospike/aerospike-client-python/issues) on the GitHub repository [aerospike/aerospike-client-python](https://github.com/aerospike/aerospike-client-python/).

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

---

<div class="post-metadata">

**Author:** ![Amit](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Amit](https://discuss.aerospike.com/u/Amit)\
**Post date:** [June 8, 2015, 6:25am UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336/3 "2015-06-08T06:25:05Z")

</div>

Thanks I have opened an issue on [github.com](http://github.com)

> <https://github.com/aerospike/aerospike-client-python/issues/59>
>
> Dear Team, 
> 
> 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.
> 
> $ python --version
> Python 2.7.6
> 
> 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-jx\_N2h-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 \<module\>
> 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)

I am using python 2.7.6

---

<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:** [June 23, 2015, 6:15am UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336/4 "2015-06-23T06:15:12Z")

</div>

Please verify if release \>= [1.0.46](https://github.com/aerospike/aerospike-client-python/releases/tag/1.0.46) fixes your problem.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Cabalona\_Jr](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/benjamin_cabalona_jr/32/1113_2.png) [@Benjamin\_Cabalona\_Jr](https://discuss.aerospike.com/u/Benjamin_Cabalona_Jr)\
**Post date:** [December 11, 2019, 8:41am UTC](https://discuss.aerospike.com/t/error-while-installing-python-client-for-aerospike/1336/5 "2019-12-11T08:41:26Z")

</div>

I also opened an error on github [https://github.com/aerospike/aerospike-client-python/issues/246](https://github.com/aerospike/aerospike-client-python/issues/246)
