Unable to install aerospike python client on ubuntu 14.10

Hi,

I tried to install python client on Ubuntu 14.10 but I am getting the following error:

sudo apt-get install python-pip liblua5.1-dev libssl-dev

sudo pip install aerospike

Downloading/unpacking aerospike Downloading aerospike-1.0.43.tar.gz (109kB): 109kB downloaded Running setup.py (path:/tmp/pip_build_root/aerospike/setup.py) egg_info for package aerospike

Installing collected packages: aerospike Running setup.py install for aerospike info: downloading ‘http://www.aerospike.com/download/client/c/3.1.11/artifact/ubuntu12’ to ‘/tmp/pip_build_root/aerospike/aerospike-client-c/package/aerospike-client-c.tgz’ % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 351 100 351 0 0 435 0 --:–:-- --:–:-- --:–:-- 434 0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0 100 15.2M 100 15.2M 0 0 66129 0 0:04:02 0:04:02 --:–:-- 252k info: extracting ‘aerospike-client-c-3.1.11.ubuntu12.04.x86_64/aerospike-client-c-devel-3.1.11.ubuntu12.04.x86_64.deb’ from ‘aerospike-client-c.tgz’ info: extracting files from ‘aerospike-client-c-3.1.11.ubuntu12.04.x86_64/aerospike-client-c-devel-3.1.11.ubuntu12.04.x86_64.deb’

CHECK
   [✓] /tmp/pip_build_root/aerospike/aerospike-client-c/package/usr/lib/libaerospike.a
   [✓] /tmp/pip_build_root/aerospike/aerospike-client-c/package/usr/include/aerospike/aerospike.h
   [✓] /tmp/pip_build_root/aerospike/aerospike-client-c/package/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
building 'aerospike' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -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
src/main/aerospike.c:17:20: fatal error: Python.h: No such file or directory
 #include <Python.h>
                    ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from 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-bmBsrV-record/install-record.txt --single-version-externally-managed --compile:
info: downloading 'http://www.aerospike.com/download/client/c/3.1.11/artifact/ubuntu12' to '/tmp/pip_build_root/aerospike/aerospike-client-c/package/aerospike-client-c.tgz'

% Total % Received % Xferd Average Speed Time Time Time Current

                             Dload  Upload   Total   Spent    Left  Speed

100 351 100 351 0 0 435 0 --:–:-- --:–:-- --:–:-- 434

0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0

100 15.2M 100 15.2M 0 0 66129 0 0:04:02 0:04:02 --:–:-- 252k

info: extracting ‘aerospike-client-c-3.1.11.ubuntu12.04.x86_64/aerospike-client-c-devel-3.1.11.ubuntu12.04.x86_64.deb’ from ‘aerospike-client-c.tgz’

info: extracting files from ‘aerospike-client-c-3.1.11.ubuntu12.04.x86_64/aerospike-client-c-devel-3.1.11.ubuntu12.04.x86_64.deb’

CHECK

[✓] /tmp/pip_build_root/aerospike/aerospike-client-c/package/usr/lib/libaerospike.a

[✓] /tmp/pip_build_root/aerospike/aerospike-client-c/package/usr/include/aerospike/aerospike.h

[✓] /tmp/pip_build_root/aerospike/aerospike-client-c/package/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 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -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

src/main/aerospike.c:17:20: fatal error: Python.h: No such file or directory

#include <Python.h>

                ^

compilation terminated.

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-bmBsrV-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.6’, ‘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)

Thanks for any help,

You’re missing the development package for Python. Check out the prerequisites here:

After you install python-dev try to install from pip again.

Ronen

Hi Ronen,

Really thanks, now its works.

Anyway, maybe you should update this: http://www.aerospike.com/docs/client/python/install/

I thought no other deps needed. :slight_smile:

Thanks again, Adam

Right on, thanks for pointing that out. I’m going to fix it.

Now that release 1.0.44 is out, behold the glory of the new installation page. Thanks for pointing out the problem!