django can't find new sqlite version? (SQLite 3.8.3 or later is required (found 3.7.17)) django can't find new sqlite version? (SQLite 3.8.3 or later is required (found 3.7.17)) django django

django can't find new sqlite version? (SQLite 3.8.3 or later is required (found 3.7.17))


I got the same error in CentOS 7.6 and Python 3.7.3 versions. I think you are using Django 2.2.* some version. In latest of Django 2.2, they changed the SQLIte version, that cause of your problem.

This is the release notes of Django 2.2 about SQLite.

The minimum supported version of SQLite is increased from 3.7.15 to 3.8.3.

So I found 3 steps to solve this problem,


  • Downgrade Django Version

So you can install latest version of Django 2.1 by using this command, which mean you're going to downgrade your Django version.

pip install Django==2.1.*

or you can followup below steps as well to keep the latest version Django. I directly get the steps from Upgrading SQLite on CentOS to 3.8.3 or Later article.

You can download the latest sqlite version from here.

wget https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gztar zxvf sqlite-autoconf-3280000.tar.gz./configuremakesudo make install

We've installed to the latest version, but the problem is same. Here,

>>> import sqlite3>>> sqlite3.sqlite_version'3.7.17'

In the article, they've mentioned about LD_RUN_PATH and LD_LIBRARY_PATH paths.

Then make sure to compile python again using the LD_RUN_PATH environment variable.It is better to use this variable over LD_LIBRARY_PATH.Using LD_LIBRARY_PATH - whenever python is run it will look for linked libraries with that path.What we want is for the libraries to be cooked into python at link time - compile time.

So based on the article, we can do the similar thing,

cd /opt/Python-x.y.zLD_RUN_PATH=/usr/local/lib  ./configureLD_RUN_PATH=/usr/local/lib makeLD_RUN_PATH=/usr/local/lib make altinstall

Then try again,

>>> import sqlite3>>> sqlite3.sqlite_version'3.31.1'

Here we go, one thing they've mentioned,

If you do not use LD_RUN_PATH, then you have to make sure that the LD_RUN_PATH environment variable is set to /usr/local/lib for every user that is going to run python - which can be really annoying to do.


This is same as the previous one and based on LD_LIBRARY_PATH approach. Here is the steps from the article,

$ wget https://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz$ tar zxvf sqlite-autoconf-3240000.tar.gz$ ./configure --prefix=/usr/local$ make$ sudo make install$$ python3.6 -c "import sqlite3; print(sqlite3.sqlite_version)"3.7.17$$ export LD_LIBRARY_PATH=/usr/local/lib$ python3.6 -c "import sqlite3; print(sqlite3.sqlite_version)"3.24.0

If the last two steps didn't work, please comment below with the error you got and I'll find another solution for you.


I solved a similar situation with the following patches of code. Follow these steps that I used on my own centos7 & everything should be alright.Just remember to let your centos7 know that you are calling python3 not just python otherwise it will call the default python2 followed by a series of errors in your virtualenv.

Installing python3 (from source):

cd ~wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xztar xJf Python-3.7.3.tar.xzcd Python-3.7.3./configuremake && make installexport PATH=$HOME/opt/python-3.7.3/bin:$PATH

Then run: source .bash_profile

Confirming by

python3 --versionPython 3.7.3 

Installing your sqlite3 (from source):

$ cd ~$ wget https://www.sqlite.org/2019/sqlite-autoconf-3290000.tar.gz$ tar zxvf sqlite-autoconf-3290000.tar.gzcd sqlite-autoconf-3290000$./configure --prefix=$HOME/opt/sqlite$ make && make install

Now this is what you should also remember to do for centos7 know where to look for your python3 and not defaulting to python2. On your .bash_profile copy & past this piece of code or edit the paths accordingly:

export PATH=$HOME/opt/sqlite/bin:$PATHexport LD_LIBRARY_PATH=$HOME/opt/sqlite/libexport LD_RUN_PATH=$HOME/opt/sqlite/lib

Make it permanent by running: source .bash_profileand you are done with sqlite3 version >= 3.8. Confirm it by:

sqlite3 --version 3.29.0 2019-07-10 17:32:03

And then you can continue to use python3 to install python3 modules like django-2.2.

python3.7 -m pip3 install virtualenv(myvenv37)[me@test my_project]$ python3.7 -m pip3 install djangoSuccessfully installed django-2.2.3 pytz-2019.1 sqlparse-0.3.0

Remember, it is

PYTHON3.7 -m pip3 install MODULE

(myvenv37)[me@test my_project]$ python3.7 manage.py runserver 

and the server should be running.

So, to conclude, in the case above it was migrate, & should look like this:

(venv)[me@test my_project]$ python3.7 manage.py migrate


As this was about Centos7, you can use the Fedora package to upgrade the Centos sqlite package:

wget https://kojipkgs.fedoraproject.org//packages/sqlite/3.8.11/1.fc21/x86_64/sqlite-3.8.11-1.fc21.x86_64.rpmsudo yum install sqlite-3.8.11-1.fc21.x86_64.rpm

(from: https://www.reddit.com/r/linuxadmin/comments/c9hy5w/trying_to_upgrade_sqlite_3717_to_version_38_on/ezrtbkm/?utm_source=reddit&utm_medium=web2x&context=3)

This seems to work, although I'm never sure if doing this is really an ideal solution to a problem or not. I guess if you're not actually using SQLite, then this at least passes the version check and so gets you working.