Installing pysqlcipher3 on CentOS

dheeraj alimchandani
3 min readApr 25, 2021

The reason to write this article is that pip installing pysqlcipher3 gives successfully installed message but behind the scene the library does not installs and gives you Module not found error. This is still easier to solve in Debian systems but becomes way difficult to debug on CentOS or Fedora. This article focuses on installing pysqlcipher3 on CentOS the right way. I haven’t tried on Fedora but I guess the same steps should do the work

Note: If you are on Debian then the process is way simpler:

$ sudo apt install sqlcipher libsqlcipher0 libsqlcipher-dev
$ sudo -H pip3 install pysqlcipher3

Installing sqlcipher on CentOS is not that straight forward compared to Ubuntu(Debian) where we can do “sudo apt install sqlcipher” as there are no sqlcipher packages available for CentOS. Therefore it has to be compiled from the source code and installed.

Installing sqlcipher

Step 1: Download the source files from github

$ git clone https://github.com/sqlcipher/sqlcipher.git

Step 2: Define SQLITE_HAS_CODEC and SQLITE_TEMP_STORE=2

$ export SQLITE_HAS_CODEC
$ export SQLITE_TEMP_STORE=2

Step 3: Install the latest openssl

$ sudo yum install openssl

--

--