Search code examples
pythondjangosqlitecentos7

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


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.


Solution

  • To check which version of SQLite Python is using:

    $ python
    Python 3.7.3 (default, Apr 12 2019, 16:23:13) 
    >>> import sqlite3
    >>> sqlite3.sqlite_version
    '3.27.2'
    

    For me the new version of sqlite3 is in /usr/local/bin so I had to recompile Python, telling it to look there:

    sudo LD_RUN_PATH=/usr/local/lib ./configure --enable-optimizations
    sudo LD_RUN_PATH=/usr/local/lib make altinstall