rigglemania / pysqlcipher3

Python 3 bindings for SQLCipher
zlib License
138 stars 42 forks source link

Failed to build pysqlcipher3 #19

Open sylwesterdigital opened 5 years ago

sylwesterdigital commented 5 years ago

$ uname -a Linux ubuntu-8gb-nbg1-1 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ pip3 install pysqlcipher3 Collecting pysqlcipher3 Using cached https://files.pythonhosted.org/packages/a4/06/1d56bdec3129eff6dd54323d249784ccd90ce03c8cae7870d45e434bae77/pysqlcipher3-1.0.3.tar.gz Building wheels for collected packages: pysqlcipher3 Running setup.py bdist_wheel for pysqlcipher3 ... done Running setup.py clean for pysqlcipher3 Failed to build pysqlcipher3 Installing collected packages: pysqlcipher3 Running setup.py install for pysqlcipher3 ... done Successfully installed pysqlcipher3

spoppi commented 4 years ago

Just in case someone runs into the same issue: Adding -vvv to pip3 command shows that sqlcipher/sqlite3.h is missing (at least here) Installing libsqlcipher-dev solved it.

kwisii commented 3 years ago

Following the instructions of this Dockerfile helped me to understand the installation process of SQLCipher before installing pysqlcipher3 correctly with needed dependencies

leosussan commented 2 years ago

I ran into this problem on an M1 Mac, using poetry. Same issue when attempting to install w/ pip. Issue is that pysqlcipher3 requires sqlcipher on the machine as a dependency, but has a problem identifying the location of the required library & includes. How I solved:

  1. (preliminary step, skip if already done) Install sqlcipher using homebrew: brew install sqlcipher
  2. Identify the installation location.
    • Run brew info sqlcipher.
    • You'll see something like the following:
      sqlcipher: stable 4.5.1 (bottled), HEAD
      ....
      /opt/homebrew/Cellar/sqlcipher/4.5.1 (13 files, 4MB)
      ...
    • Set that path to a variable: SQLCIPHER_PATH="/opt/homebrew/Cellar/sqlcipher/4.5.1"
  3. Set the following environment variables based on the SQLCIPHER_PATH var set above:
    export LIBRARY_PATH="$SQLCIPHER_PATH/lib"
    export C_INCLUDE_PATH="$SQLCIPHER_PATH/include"
  4. Attempt the pysqlcipher3 install (via poetry add pysqlcipher3 or pip install pysqlcipher3, etc etc)

This resolved the issue for me, hopefully this is helpful to others.

jovermann commented 1 year ago

Brilliant! This resolved the same issue (pysqlcipher3 not installable) for signal-export/sigexport on my M1 Mac for me! Thanks a lot! I confirm leosussans steps above work (I was using pip3).

Concrete steps:

brew info sqlcipher      # note the path
export SQLCIPHER_PATH=/opt/homebrew/Cellar/sqlcipher/4.5.5
export LIBRARY_PATH="$SQLCIPHER_PATH/lib"
export C_INCLUDE_PATH="$SQLCIPHER_PATH/include"
pip3 install pysqlcipher3
sigexport --list-chats    # now works
salimfaraj commented 11 months ago

hello, I am using windows, I have no idea about mac

i have compile sqlcipher on windows

C:\Users\pcc\Desktop\sqlcipher-master\sqlcipher-master>sqlite3.exe
SQLite version 3.42.0 2023-05-16 12:36:15 (SQLCipher 4.5.5 community)
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite>

but, i dont know how to import it to my python project in pycharm and use it normally

kwisii commented 11 months ago

After building sqlcipher on your system you have to install pysqlcipher via the setup.py file python setup.py install. Afterwards you should be able to import the module via import pysqlcipher3.dbapi2 as sqlite

salimfaraj commented 10 months ago

kwisii, please can i contacted you elsewhere, I have tried it it it failed I am not sure if I am using the correct folder or not. where can I find you ? I am in need to solve this issue .. this is being a tiresome for me .

salimfaraj commented 10 months ago
note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pysqlcipher3
Failed to build pysqlcipher3
ERROR: Could not build wheels for pysqlcipher3, which is required to install pyproject.toml-based projects

this error accurred when trying to install pip install pysqlcipher3