5

ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version) django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later

I met with this problem at the django project, mismatching version for the sqlite3 and the django. this occurs at the centos7 env, and I also want a convenient solution that works in the container env.

imissyou
  • 123
  • 2
  • 5

4 Answers4

6

I solved this issue by upgrading my version of sqlite3 using this command:

cd ~ && wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz && tar xvfz sqlite-autoconf-3320100.tar.gz && cd sqlite-autoconf-3320100 && ./configure && make && make install

I am using ElasticBeanstalk for my setup, so I added a .config file to the .ebextensions folder and put this in it:

option_settings:
  aws:elasticbeanstalk:application:environment:
    LD_LIBRARY_PATH: "/usr/local/lib"
commands:
  01_upgrade_sqlite:
    command: "cd ~ && wget https://www.sqlite.org/2020/sqlite-autoconf-3320100.tar.gz && tar xvfz sqlite-autoconf-3320100.tar.gz && cd sqlite-autoconf-3320100 && ./configure && make && make install"

Many thanks to Bejür for adding the LD_LIBRARY_PATH environment variable here in order to get it to work.

Bejür
  • 110
  • 2
  • 7
kloddant
  • 1,026
  • 12
  • 19
1

In my case, upgrading sqlite with kloddant's instructions helped only partially. SQLite was installed, but python was still referring to the old sqlite version.

An additional step to fix this issue was setting the environment variable LD_LIBRARY_PATH="/usr/local/lib"

Add it to .ebextensions/*.config

option_settings:
  "aws:elasticbeanstalk:application:environment":
    LD_LIBRARY_PATH: "/usr/local/lib"
kloddant
  • 1,026
  • 12
  • 19
Bejür
  • 110
  • 2
  • 7
  • Did this really work? I've tried this as well as adding a command `command: export LD_LIBRARY_PATH=/usr/local/lib`, but I keep getting the error `deterministic=True requires SQLite 3.8.3 or higher`. – Berco Beute Apr 16 '21 at 21:54
  • Something must have changed with Elastic Beanstalk. My answer worked back then, but now it stopped working until I added this bit from you. Thank you so much! I'll incorporate your answer into mine for future viewers. – kloddant Sep 15 '21 at 17:32
-1

You have an outdated version of SQLite,you can try this:

python -m pip install -U sqlite
xkcdjerry
  • 965
  • 4
  • 15
-4

I now find a usable solution: change the version of Django from 'Django==3.0.4' to 'Django==2.1.8' and it worked.

pip install django==2.1.8 -i https://mirrors.aliyun.com/pypi/simple/

imissyou
  • 123
  • 2
  • 5