Problem Description
Starting with the Python Client version 3.8.0 and above, when using pip version 19.0 or above on linux platforms, pip will install the Aerospike Python Client via the download of a manylinux2010 wheel.
This install should work on most linux variants release since 2010, instead of only the ones that we specifically support with a c-client download.
Dependencies no longer need to be installed, since they are now bundled in with the wheel install itself.
The installation experience should be better for most users, but some may prefer to install the client using the old method. For example, some users may wish to build the client to use a specific openssl installed on their system instead of the version we bundle in.
Explanation
The installation type can be viewed when installing via pip with the verbose option enabled.
Here's an example manylinux2010 installation with bundled openssl on docker ubuntu image:
$ docker run --rm -it ubuntu:18.04 bash ... $ apt update -y ... $ apt install python curl binutils -y ... $ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py ... $ python get-pip.py ... $ pip install aerospike --verbose ... Downloading https://files.pythonhosted.org/packages/d1/0c/5a0d30f7597e8d7a9de79575c7e2ec68e08471a62edffc67f037d238901e/aerospike-3.9.0-cp27-cp27mu-manylinux2010_x86_64.whl (3.9MB) ... Successfully installed aerospike-3.9.0 ... $ ls -lat /usr/local/lib/python2.7/dist-packages/.libsaerospike/ total 4324 drwxr-sr-x 2 root staff 4096 Jan 2 23:34 . drwxrwsr-x 12 root staff 4096 Jan 2 23:34 .. -rwxr-xr-x 1 root staff 723704 Jan 2 23:34 libssl-520a8983.so.1.1 -rwxr-xr-x 1 root staff 92080 Jan 2 23:34 libz-eb09ad1d.so.1.2.3 -rwxr-xr-x 1 root staff 3599448 Jan 2 23:34 libcrypto-b6f6726c.so.1.1 $ strings /usr/local/lib/python2.7/dist-packages/.libsaerospike/libssl-520a8983.so.1.1 | grep "OpenSSL" OpenSSL 1.1.1c 28 May 2019 $ strings /usr/lib/x86_64-linux-gnu/libssl.so.1.1 | grep OpenSSL OpenSSL 1.1.1 11 Sep 2018 $ openssl version OpenSSL 1.1.1 11 Sep 2018
Here's an example install from source and setup.py using no-binary option and system openssl dependency:
$ docker run --rm -it ubuntu:18.04 bash
...
$ apt update -y
...
$ apt install python curl binutils -y
...
$ apt install build-essential python-dev libssl-dev zlib1g-dev -y
...
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
...
$ python get-pip.py
...
$ pip install --user aerospike --no-binary :all:
...
Running setup.py install for aerospike ... info: Executing ./scripts/aerospike-client-c.sh
info: downloading 'https://artifacts.aerospike.com/aerospike-client-c/4.6.8/aerospike-client-c-devel-4.6.8.ubuntu18.04.x86_64.deb' to '/tmp/pip-install-iAAMpn/aerospike/aerospike-client-c/package/aerospike-client-c-devel-4.6.8.ubuntu18.04.x86_64.deb'
...
Successfully installed aerospike-3.9.0
...
$ ls -lat /usr/local/lib/python2.7/dist-packages/.libsaerospike
ls: cannot access '/usr/local/lib/python2.7/dist-packages/.libsaerospike': No such file or directory
$ strings /usr/lib/x86_64-linux-gnu/libssl.so.1.1 | grep OpenSSL
OpenSSL 1.1.1 11 Sep 2018
$ openssl version
OpenSSL 1.1.1 11 Sep 2018
As shown, the manylinux install comes with a bundled version of openssl that is different from the system openssl, but the source/setup.py install does not.
Solution
To install a manylinux2010 wheel on most linux platforms using bundled openssl, use pip version 19.0 or above and the Aerospike Python Client version 3.8.0 or above:
$ pip install --user aerospike
To instead force an install from source/setup.py using system openssl, specify the no-binary option after installing required dependencies:
$ pip install --user aerospike --no-binary :all:
-
The client git repo has
more detailsabout custom builds from source. -
Other python packages, such as cryptography, have been distributing manylinux wheels with bundled openssl by default on pip for a few years now.
Example manylinux openssl with default cryptography install:
$ pip install cryptography
$ python -c "from cryptography.hazmat.backends.openssl import backend; print(backend.openssl_version_text())"
OpenSSL 1.1.1d 10 Sep 2019
$ openssl version
OpenSSL 1.1.1 11 Sep 2018
Example source build with system openssl for cryptography:
$ apt install build-essential libssl-dev libffi-dev python-dev -y
$ pip install cryptography --no-binary :all:
$ python -c "from cryptography.hazmat.backends.openssl import backend; print(backend.openssl_version_text())"
OpenSSL 1.1.1 11 Sep 2018
$ openssl version
OpenSSL 1.1.1 11 Sep 2018