pysqlcipher3找不到sqllite3共享库
Pysqlcipher3 cannot find sqllite3 shared library
我为 ARM 板定制了 linux OS。
我在 yocto 构建中为平台编译了 pysqlcipher3。 python3 程序无法识别共享库中的 sqlite3 符号。
>>> from pysqlcipher3 import dbapi2 as sqlcipher
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/pysqlcipher3/dbapi2.py", line 33, in <module>
from pysqlcipher3._sqlite3 import *
ImportError: /usr/lib/python3.5/site-packages/pysqlcipher3/_sqlite3.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: sqlite3_enable_load_extension
但是我在yocto中添加了sqlite3包。我确定了 rootfs 中的库。
/usr/lib/libsqlite3.so.0
我已经使用 nm 命令检查了库中的符号,它似乎缺少符号 (sqlite3_enable_load_extension)。
请帮我解决这个问题。
一些论坛建议使用 LD_PRELOAD 选项,它会混淆 sqlcipher 操作
当我尝试打开数据库时出现此错误
getSingle failed file is encrypted or is not a database
pysqlcipher 模块依赖于设备中的 libsqlcipher.so 库。应使用 --enable-load-extension 构建 libsqlcipher 以避免此错误
对于 Yocto 构建,我在 sqlcipher 配方文件中添加了标志以避免该问题。
EXTRA_OECONF = "--enable-load-extension --disable-tcl CFLAGS=-DSQLITE_HAS_CODEC"
我为 ARM 板定制了 linux OS。 我在 yocto 构建中为平台编译了 pysqlcipher3。 python3 程序无法识别共享库中的 sqlite3 符号。
>>> from pysqlcipher3 import dbapi2 as sqlcipher
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/pysqlcipher3/dbapi2.py", line 33, in <module>
from pysqlcipher3._sqlite3 import *
ImportError: /usr/lib/python3.5/site-packages/pysqlcipher3/_sqlite3.cpython-35m-arm-linux-gnueabihf.so: undefined symbol: sqlite3_enable_load_extension
但是我在yocto中添加了sqlite3包。我确定了 rootfs 中的库。
/usr/lib/libsqlite3.so.0
我已经使用 nm 命令检查了库中的符号,它似乎缺少符号 (sqlite3_enable_load_extension)。 请帮我解决这个问题。 一些论坛建议使用 LD_PRELOAD 选项,它会混淆 sqlcipher 操作
当我尝试打开数据库时出现此错误
getSingle failed file is encrypted or is not a database
pysqlcipher 模块依赖于设备中的 libsqlcipher.so 库。应使用 --enable-load-extension 构建 libsqlcipher 以避免此错误
对于 Yocto 构建,我在 sqlcipher 配方文件中添加了标志以避免该问题。
EXTRA_OECONF = "--enable-load-extension --disable-tcl CFLAGS=-DSQLITE_HAS_CODEC"