4

I've cloned a django project to a 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.

SIMMORSAL
  • 143

3 Answers3

3

I came across the same issue. I had installed sqlite 3.28.0, but I was getting the same error while migrating.

checking the output of the error I could see that the line 63 of the base.py file raised the exception due to the call of sqlite_version_info function.

you can see the specification at this link: DB-API 2.0 specification

sqlite3.sqlite_version_info
"The version number of the run-time SQLite library, as a tuple of integers."

The solution that I found after some testing was to set LD_LIBRARY_PATH with the path to the new sqlite:

export LD_LIBRARY_PATH="/usr/local/lib"

After set this variable, you can check the result with a little python script:

from sqlite3 import dbapi2 as Database
print(Database.sqlite_version_info)

and the result should be something like this: (3,28,0)

With this approach I could migrate and continue the django setup. I will update this post in case I will find other solutions. Hope this helps

Moreno
  • 46
0

For me, downgrading Django to a previous version, solved it:

pip install Django==2.1.* --user
Noam Manos
  • 2,222
0

I had this same problem. My solution was to build sqlite3 from source, with the configuration :

configure --prefix="/usr" --libdir="${exec_prefix}/lib64"

Build and sudo make install.

Then I had to :

cd /usr/lib64 && sudo ln -sf libsqlite3.so.0.8.6 libsqlite3.so.0

The libsqlite3.so.0 link had pointed to libsqlite3.so.0.8.6-3.7, my backup of the old libsqlite3.so, and it needed to point to the newly installed library.