Report this

What is the reason for this report?

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

Posted on April 15, 2019

I’ve cloned a django project to a Centos 7 vps and I’m trying to run it now, but I get this error when trying to migrate:

$ python manage.py migrate
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

When I checked the version for sqlite, it was 3.7.17, so I downloaded the newest version from sqlite website and replaced it with the old one, and now when I version it, it gives:

$ sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7

Still when I try to migrate the project, I get the exact same message as before which means the newer version is not found. I’m new to linux and would appreciate any help.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Greetings!

I’m not that much of an expert on using sqlite in Python, but I at least have an idea. Try adding this at the top of manage.py:

import sqlite3

If that still doesn’t have the latest version, the application you’re running may be built for a newer version of Python.

Jarland

I had the same issue but didnt want to deviate from installing standard packages so I downgraded the Django version to 2.1

pip3 install --upgrade Django==2.1

…which seems to have worked.

Confirm the Location of the Old SQLite: First, check where the older version of SQLite is located:

which sqlite3
  • If this points to /usr/bin/sqlite3, it’s likely that this is the system-wide version that Python is still using.

  • Verify Python’s SQLite Bindings: Python has built-in bindings for SQLite (pysqlite), and these may still be linked to the old version. Check which SQLite version your Python environment is using:

python -c "import sqlite3; print(sqlite3.sqlite_version)"
  • If it returns 3.7.17, that’s confirmation that Python is still using the older version.

  • Recompile Python with the New SQLite: To force Python to use the newer version of SQLite, you may need to recompile Python so that it links against the correct version of SQLite.

    Steps:

    a. Install necessary build dependencies:

sudo yum groupinstall "Development Tools"
sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.