Quickstart / Installation¶
The BigchainDB Python Driver depends on:
libffi/ffi.h- Python 3.5+
- A recent Python 3 version of
pip - A recent Python 3 version of
setuptools
If you’re missing one of those, then see below. Otherwise, you can install the BigchainDB Python Driver (bigchaindb_driver) using:
pip install bigchaindb_driver
and then you can try the Basic Usage Examples.
How to Install the Dependencies¶
Dependency 1: ffi.h¶
BigchainDB (server and driver) depends on cryptoconditions,
which depends on PyNaCl (Networking and Cryptography library),
which depends on ffi.h.
Hence, depending on your setup, you may need to install the
development files for libffi.
On Ubuntu 14.04 and 16.04, this works:
sudo apt-get update
sudo apt-get install libffi-dev
On Fedora 23 and 24, this works:
sudo dnf update
sudo dnf install libffi-devel
For other operating systems, just do some web searches for “ffi.h” with the name of your OS.
Dependency 2: Python 3.5+¶
The BigchainDB Python Driver uses Python 3.5+. You can check your version of Python using:
python --version
An easy way to install a specific version of Python, and to switch between versions of Python, is to use virtualenv. Another option is conda.
Dependency 3: pip¶
You also need to get a recent, Python 3 version of pip, the Python package manager.
If you’re using virtualenv or conda, then each virtual environment should include an appropriate version of pip.
You can check your version of pip using:
pip --version
pip was at version 9.0.0 as of November 2016.
If you need to upgrade your version of pip,
then see the pip documentation
or our page about that in the BigchainDB Server docs.
Dependency 4: setuptools¶
Once you have a recent Python 3 version of pip, you should be able to upgrade setuptools using:
pip install --upgrade setuptools
Installing from the Source Code¶
The source code for the BigchainDB Python Driver can be downloaded from the Github repo. You can either clone the public repository:
git clone git://github.com/bigchaindb/bigchaindb-driver
Or download the tarball:
curl -OL https://github.com/bigchaindb/bigchaindb-driver/tarball/master
Once you have a copy of the source code, you can install it by going to the directory containing setup.py and doing:
python setup.py install
Installing latest master with pip¶
In order to work with the latest BigchainDB (server) master branch:
$ pip install --process-dependency-links git+https://github.com/bigchaindb/bigchaindb-driver.git
Point to some BigchainDB node, which is running BigchainDB server master:
from bigchaindb_driver import BigchainDB
bdb = BigchainDB('http://here.be.dragons:9984')