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/default/lib
export LD_RUN_PATH=/home/felix/.local/sqlite/default/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. Create a venv and install django and start a demo project
cd /tmp
/home/felix/.local/python/python-3.9.1/bin/python3 -m venv venv
source venv/bin/activate
pip install django
djagno-admin startproject demo
cd demo
4 Check sqlite3 lib version (seems to be OK, sqlite_version is 3.34.0)
(venv) [felix@localhost blueprint]$ python manage.py shell
Python 3.9.0 (default, Jan 20 2021, 12:53:25)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.34.0'
>>> sqlite3.version
'2.6.0'
>>>
5. Run the demo project (cannot find the new sqlite version ? strange.):
(venv) [felix@localhost blueprint]$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 215, in get_new_connection
create_deterministic_function('django_date_extract', 2, _sqlite_datetime_extract)
sqlite3.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/felix/.local/python/python-3.9.0/lib/python3.9/threading.py", line 950, in _bootstrap_inner
self.run()
File "/home/felix/.local/python/python-3.9.0/lib/python3.9/threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/core/management/commands/runserver.py", line 121, in inner_run
self.check_migrations()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/core/management/base.py", line 459, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 18, in __init__
self.loader = MigrationLoader(self.connection)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/migrations/loader.py", line 53, in __init__
self.build_graph()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/migrations/loader.py", line 216, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/migrations/recorder.py", line 77, in applied_migrations
if self.has_table():
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/migrations/recorder.py", line 55, in has_table
with self.connection.cursor() as cursor:
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 259, in cursor
return self._cursor()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 235, in _cursor
self.ensure_connection()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/base/base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/home/felix/PycharmProjects/blueprint/venv/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 215, in get_new_connection
create_deterministic_function('django_date_extract', 2, _sqlite_datetime_extract)
django.db.utils.NotSupportedError: deterministic=True requires SQLite 3.8.3 or higher
Anyone can give help on this issue. Thanks .
--
Code everyday.