1

I am trying to create a django application on a server running on Centos 7. When i tried to migrate the application, i got the error:"SQLite 3.8.3 or later required (found 3.7.17)."

Thereafter I installed the latest-version of Sqlite3. When i run sqlite3 --version, it showns 3.28.0 which is the latest version.

Howevere, when I tried my migrate the project I got the same error i.e "SQLite 3.8.3 or later required (found 3.7.17)." Can someone please suggest how to ensure that python/django is configured with the latest version of sqlite3 rather than the older one which came along with the OS?

Alasdair
  • 298,606
  • 55
  • 578
  • 516
  • 4
    Possible duplicate of [How to upgrade sqlite 3.8.2 to >= 3.8.3](https://stackoverflow.com/questions/55508830/how-to-upgrade-sqlite-3-8-2-to-3-8-3) – Shawn Apr 18 '19 at 12:08
  • 1
    (That's for Ubuntu, the fix is probably the same, though.) – Shawn Apr 18 '19 at 12:09
  • 1
    @Alasdair I just checked with the Python 3.7.3 source, and there is no sqlite3.c bundled with it. The Python sqlite3 module instead loads an OS provided shared library. I just tested and my system Python is now using sqlite 3.28, which is installed at `/usr/local/lib/libsqlite3.so`, instead of the OS provided 3.22.0 at `/usr/lib/x86_64-linux-gnu/libsqlite3.so`, without me having to do anything special. (On Ubuntu, so OP might have to do something slightly different path or environment wise for CentOS). – Shawn Apr 18 '19 at 12:19
  • Hello guys, I have done all that was suggested in the above post. Also did a research for installing and linking the updated version of python, but nothing worked. I am using python virtual environments (with Python 3.6) while the python version that came with the OS was 2.7. Is this happening because of virtual environments. – Abhijeet Chakravarty Apr 20 '19 at 04:02
  • Having the same problem on CentOS 7 with Python 3.6. Am unable to reproduce the fix that worked in Ubuntu. – camslice May 20 '19 at 17:15
  • Just followed the instructions here to compile Python from source: https://www.code-learner.com/how-to-compile-and-install-python3-from-source-code-in-centos/ Using the `./configure` and `make` commands detailed here: https://stackoverflow.com/questions/55508830/how-to-upgrade-sqlite-3-8-2-to-3-8-3 Can confirm this works on CentOS 7.6.1810 with Python 3.7.2 and SQLite 3.28.0 – camslice May 20 '19 at 17:44

1 Answers1

1

Unfortunately CentOS only has v3.7.17 in their repos. So you need to install v3.8.3 or the latest from source.

To do that, you can install from source (I'm not sure how to use the precompile binaries)

Download the source code from sqlite downloads

cd /opt
wget https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz
tar -xzf sqlite-autoconf-3280000.tar.gz
cd sqlite-autoconf-3280000
./configure
make
sudo make install
Tayyab Vohra
  • 1,512
  • 3
  • 22
  • 49