Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ModuleNotFoundError: No module named 'pysqlcipher3'" error while using Python 3.7 on windows 10

I am trying to decrypt one database file using Python 3.7. To decrypt it, I have to use pysqlcipher3 version for python 3.7. To install it, I have tried by using both commands:

pip3 install pysqlcipher3

and

pip install pysqlcipher3

and both the commands have showed successful installation of the pysqlcipher package. However, when I try to import pysqlcipher3 in my Python project by using this line:

from pysqlcipher3 import dbapi2 as sqlite

it displays this error:

ModuleNotFoundError: No module named 'pysqlcipher3

I have checked various GitHub projects, but none of them provide a clear working solution. The Python packages website says to install libsqlcipher in your OS but this time the issue is same, no documentation and link regarding for the installation of libsqlcipher for Windows 10. Can anyone provide me with proper installation steps, or any document, or any video tutorial, regarding the same? Or is there some issue with the import statement?

like image 864
sak Avatar asked Jan 10 '19 12:01

sak


1 Answers

I don't normally post answers, but this worked for me on Ubuntu:

$ git clone https://github.com/coleifer/sqlcipher3
$ cd sqlcipher3
$ python setup.py build  # Build against the system libsqlcipher
$ sudo python setup.py install

$ cd ..

then enter a python prompt and try:

 from sqlcipher3 import dbapi2 as sqlcipher
like image 164
Gordon Long Avatar answered Oct 25 '22 05:10

Gordon Long