Neurohazard
暮雲煙月,皓首窮經;森羅萬象,如是我聞。

SQLite版本过低导致Django 2.2.3启动错误解决办法

wpadmin~August 19, 2019 /System Management

Contents

SQLite版本过低导致Django 2.2.3启动错误解决办法

遇到的错误

在 CentOS 7 中通过 python manage.py runserver 0.0.0.0:8000 起到你 Django 的时候会抛出异常导致无法无法启动。原因是因为系统自带的 SQLite3 版本太低导致无法启动。那么就需要升级 SQLite 版本了。

raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

下载最新SQLite最新版本并编译安装

# 下载并解压
[root@linux ~]# wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz
[root@linux ~]# tar xf sqlite-autoconf-3270200.tar.gz
# configure 生成makefile并指定安装路径
[root@linux ~]# cd sqlite-autoconf-3270200
[root@linux sqlite-autoconf-3270200]# ./configure --prefix=/usr/local/
[root@linux sqlite-autoconf-3270200]# make && make install

设置软链接替换旧版本

# 备份旧版本
[root@linux ~]# mv /usr/bin/sqlite3 /usr/bin/sqlite3_backupold
# 链接新版本
[root@linux ~]# ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
# 环境变量设置
[root@linux ~]# vim ~/.bashrc

在文件末尾添加以下内容

export LD_LIBRARY_PATH="/usr/local/lib"

原文

https://webcache.googleusercontent.com/search?q=cache:e2s40A4DoIMJ:https://www.pyacer.com/detail/1/+&cd=22&hl=en&ct=clnk&gl=us

Leave a Reply

Your email address will not be published. Required fields are marked *