django.core.exceptions.ImproperlyConfigured:需要 SQLite 3.9.0 或更高版本(发现 3.7.17)在 Apache 日志中观察到错误

django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17) Error Observed in Apache Logs

我在 apache 错误日志中遇到以下错误。

''' django.core.exceptions.ImproperlyConfigured:需要 SQLite 3.9.0 或更高版本(找到 3.7.17) '''

我在虚拟环境和非虚拟环境(标准)中都验证了sqlite3版本。我可以在 python 中看到最新的 sqlite3。 ''' $python3.7 Python 3.7.12(默认,2021 年 11 月 8 日,09:02:58) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] linux 键入“帮助”、“版权”、“致谢名单”或“许可”以获取更多信息。

from sqlite3 import dbapi2 as Database Database.sqlite_version_info (3, 36, 0) '''

以下是来自 apache 网络服务器的错误日志。

[Mon Nov 08 15:02:33.698244 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]     backend = load_backend(db['ENGINE'])
[Mon Nov 08 15:02:33.698249 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]   File "/home/rafiq/myprojectenv/lib/python3.7/site-packages/django/db/utils.py", line 111, in load_backend
[Mon Nov 08 15:02:33.698252 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]     return import_module('%s.base' % backend_name)
[Mon Nov 08 15:02:33.698257 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]   File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
[Mon Nov 08 15:02:33.698260 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]     return _bootstrap._gcd_import(name[level:], package, level)
[Mon Nov 08 15:02:33.698265 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]   File "/home/rafiq/myprojectenv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 73, in <module>
[Mon Nov 08 15:02:33.698267 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]     check_sqlite_version()
[Mon Nov 08 15:02:33.698273 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]   File "/home/rafiq/myprojectenv/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 69, in check_sqlite_version
[Mon Nov 08 15:02:33.698276 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615]     'SQLite 3.9.0 or later is required (found %s).' % Database.sqlite_version
[Mon Nov 08 15:02:33.698294 2021] [wsgi:error] [pid 1459] [remote 192.168.0.105:62615] django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).

我看到了最新版本 python 但是为什么 apache 抱怨它找到了 3.7.17,有人可以帮忙修复它吗,谢谢!!

我试过这个解决方案,它有效: https://programmerah.com/solved-django-core-exceptions-improperlyconfigured-sqlite-3-9-0-or-later-is-required-found-3-7-17-29493/

我通过以下步骤解决了问题。

mv /usr/bin/sqlite3 /usr/bin/sqlite3_3.7.9
ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3

我遵循的文档不包含上述两个命令,这有助于解决实际问题。