[Solved] Django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17).

CentOS comes with 3.7.17 Django, which is not supported. It must be above 3.9.0. If you want to use SQLite3 as a database, there is no way to upgrade it. If it is me, I will not use SQLite3, but use mysql

The upgrade is simple:

1. Download the latest package of SQLite3

https://www.sqlite.org/download.html

wget https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz

2. Compile and install

tar xf https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz
cd sqlite-autoconf-3350500
./configure --prefix=/usr/local/ && make && make install 

3. Change the original SQLite3 command

First check which directory SQLite3 has executable files in

(python36) [[email protected] servermonitor]# whereis sqlite3
 sqlite3: /usr/bin/sqlite3 /usr/local/bin/sqlite3 /usr/include/sqlite3.h /usr/share/man/man1/sqlite3.1.gz (python36) [[email protected] servermonitor]#

It is found that/usr/bin/SQLite3 is old, 3.7.17. If you are not sure, just execute it

/usr/bin/sqlite3 –verssion

Then replace the old version

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

4. Change the library path

Many small partners went to the above and tested it. They found that the same error was still reported when executing Python manage.py runserver 8080. The reason is that Django read the old library, and you can verify it yourself

(python36) [[email protected] servermonitor]# python 
Python 3.6.8 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 
(Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information.
 >>> import sqlite3
 > >>> sqlite3.sqlite_version 
 > '3.7.17'      
>>> .exit

Modifying library variables

export LD_LIBRARY_PATH="/usr/local/lib/"

Retest

(python36) [[email protected] servermonitor]# python Python 3.6.8
 (default, Nov 16 2020, 16:55:22) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux Type "help", "copyright", "credits" or "license" for more information.
  >>> import sqlite3
  > >>> sqlite3.sqlite_version
  '3.35.5'          
  >>> exit()

Execution returned to normal

(python36) [[email protected] servermonitor]# python manage.py runserver 8080
 Django version 3.2.4, using settings 'servermonitor.settings' Starting development server at
http://127.0.0.1:8080/ Quit the server with CONTROL-C.


Read More: