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

7

18

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?

Isla answered 10/1, 2019 at 12:3 Comment(8)
It is likely that your environment has two Python installations and the version of pip.exe that you called is the one for the environment you don't expect. Navigate to the folder under Python37 where pip.exe is installed (in Windows it is in Scripts) and run it from there.Vestry
Make sure you used relevant pip (can run: which pip) with the python interpeter you are usingBalboa
@Balboa I have previously tried by installing many other packages using pip from cmd and they work fine.Isla
@TheOnionMaster Well i uninstalled everything and installed it by using pip3, it worked but still not able to decrypt the db.Its a very complicated process for windows and was not that worth to spend time upon plus there is not any single complete guide to do this so you need to collect data from various sources.Isla
What is the name of your python file?Haydeehayden
blog.actorsfit.com/…Declarant
This is very common question and I gave a pretty extensive answer a while ago. Maybe it is helpful for your case as well. See https://mcmap.net/q/742642/-modulenotfounderror-no-module-named-39-39Pumping
refer here for windows installation : github.com/rigglemania/pysqlcipher3/issues/21Underwrite
F
1

You need to install de library libsqlcipher-dev from your repository manager, for example:

sudo apt install libsqlcipher-dev

Frangos answered 2/3, 2022 at 19:13 Comment(0)
B
1

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
Bowery answered 8/5, 2022 at 3:11 Comment(0)
J
0

Check if you have multiple pip installations by using
where pip

Also, check the interpreter being used in your project. Make sure it matches the python interpreter corresponding to the pip installation where the module was installed.

Jambalaya answered 10/10, 2020 at 6:30 Comment(0)
L
0

You might have to install libsqlcipher from source.

From https://github.com/sqlcipher/sqlcipher

Using MSVC

On Windows, all applicable build products can be compiled with MSVC. First open the command prompt window associated with the desired compiler version (e.g. "Developer Command Prompt for VS2013"). Next, use NMAKE with the provided "Makefile.msc" to build one of the supported targets.

For example:

mkdir bld
cd bld
nmake /f Makefile.msc TOP=..\sqlite
nmake /f Makefile.msc sqlite3.c TOP=..\sqlite
nmake /f Makefile.msc sqlite3.dll TOP=..\sqlite
nmake /f Makefile.msc sqlite3.exe TOP=..\sqlite
nmake /f Makefile.msc test TOP=..\sqlite

There are several build options that can be set via the NMAKE command line. For example, to build for WinRT, simply add "FOR_WINRT=1" argument to the "sqlite3.dll" command line above. When debugging into the SQLite code, adding the "DEBUG=1" argument to one of the above command lines is recommended.

SQLite does not require Tcl to run, but a Tcl installation is required by the makefiles (including those for MSVC). SQLite contains a lot of generated code and Tcl is used to do much of that code generation.

Lamphere answered 8/7, 2021 at 6:51 Comment(0)
J
0

go checkout where your pip from by using pip -V, it outputs the pip path to you.

Check if this path is in the venv you want. If not, the package was installed in a wrong path.

Jadejaded answered 28/9, 2021 at 7:14 Comment(0)
C
-1

Check if you have multiple python versions installed on your Operating System. Also if you are using a virtual environment you should activate that before installing any packages.

Concomitance answered 13/1, 2022 at 21:35 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewVail
A
-2

You'll need to install sqlcipher and the python library pysqlcipher3 with something like:

brew install sqlcipher
pip3 install pysqlcipher3 --user
Accurate answered 26/4, 2021 at 8:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.