The default way is to replace the pre-installed SQLite library with the one we compiled containing the LiteSync.


The Python's sqlite3 module interfaces with the installed

We can check it using the command bellow:

ldd /usr/lib/python2.7/lib-dynload/

1. Get LiteSync

You can either compile it or use pre-compiled binaries. You can request them by e-mail for testing purposes.

It should be installed on the /usr/lib folder.

2. Install it for Python

We have 3 options to make Python use the modified SQLite library containing LiteSync:

A. Use the LD_LIBRARY_PATH when opening python

LD_LIBRARY_PATH=/usr/lib python

B. Overwrite the pre-installed library

cd /usr/lib/arm-linux-gnueabihf  (or x86_64-linux-gnu, it depends on the architecture)

ln -sf /usr/lib/

C. Set the rpath in the wrapper library

For this we need patchelf:

git clone

cd patchelf




sudo make install

To set the rpath in the wrapper library:

patchelf --set-rpath /usr/lib /usr/lib/python2.7/lib-dynload/

To check if it was successful:

objdump -p /usr/lib/python2.7/lib-dynload/ | grep RPATH


Replace the file sqlite3.dll in the folder \Python\DLLs with the one containing LiteSync.


Then we can use the sqlite3 module normally, passing a URI in the place of the filename.

Example code:

import sqlite3

conn = sqlite3.connect('file:data.db?node=secondary&connect=tcp://server:port')