sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

panfei cnweike at gmail.com
Wed Jan 20 14:54:39 EST 2021


System environment:

Cent OS 7
Sqlite3 3.34.0 (Compile from source)
Python 3.9.1 (Compile from source)
Django 3.1.5 (Pip install)


1. Compile sqlite3:
./configure --prefix=/home/felix/.local/sqlite/sqlite-3.34.0
make && make install

2. Add sqlite3 lib to lib search path:

export LD_LIBRARY_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/lib
export LD_RUN_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/lib

3. Compile Python 3.9.1
C_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/ CPLUS_INCLUDE_PATH=/home/felix/.local/sqlite/sqlite-3.34.0/include/ LD_RUN_PATH=/home/felix/.local/sqlite/default/lib ./configure --prefix=/home/felix/.local/python/python-3.9.1 --enable-optimizations
make && make install

4. Test sqlite3
Python 3.9.1 (default, Jan 20 2021, 14:32:50)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> conn = sqlite3.connect(':memory:')
>>> conn.create_function('f', 2, lambda *args: None, deterministic=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
sqlite3.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher
>>> sqlite3.sqlite_version
'3.34.0'
>>> sqlite3.version
'2.6.0'
>>> 

It reports "deterministic=True requires SQLite 3.8.3 or higher", but when execute sqlite3.sqlite_version it returns 3.34.0 which higher than 3.8.3.

Is there any advice on this issue? thanks.


More information about the Python-list mailing list