报错django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

报错信息

django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

解决方案

  1. 卸载django: pip3 uninstall django
  2. 安装低版本: pip3 install django==1.1.11


查看sqlite3版本

sqlite3 --version

下载:

wget http://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz

解压:

tar zxvf sqlite-autoconf-3280000.tar.gz -C /usr/src/

编译安装:

cd /usr/src/sqlite-autoconf-3280000/

./configure --prefix=/usr/local/sqlite

make && make install

替换版本

mv /usr/bin/sqlite3 /usr/bin/sqlite3_old

ln -s /usr/local/sqlite/bin/sqlite3 /usr/bin/sqlite3

共享库修改,注意sqlite的安装路径

vim /etc/profile

export LD_LIBRARY_PATH="/usr/local/sqlite/lib"

配置生效

source /etc/profile

查看sqlite版本信息

sqlite3 --version

3.28.0 2019-04-16 19:49:53 884b4b7e502b4e991677b53971277adfaf0a04a284f8e483e2553d0f83156b50

python查看sqlite版本信息:

[root@crawler-03 bin]# python3

>> import sqlite3

>>> sqlite3.sqlite_version

'3.28.0'

运行django

python3 manage.py runserver 0.0.0.0:8888


  上一篇:linux机器重启报错 Failed to load SELinux policy. Freezing

湘ICP备19016894号 © 2019 小钱