问题描述:
在centos7系统上执行python3.6 manage.py startapp polls创建app是报错:
django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
解决方法一:给现有django降级
1. 卸载现有django: pip3 uninstall django
2. 安装低版本Django: pip3 install django ==2.2.11
解决方法二:升级sqlite3
1. 系统默认的sqlite3版本:
[root@mysql ~]# /usr/bin/sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668
2. 安装sqlite3最新版SQLite 3.8.3
[root@mysql ~]# wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz
[root@mysql ~]# tar -zxvf sqlite-autoconf-3270200.tar.gz
[root@mysql ~]# cd sqlite-autoconf-3270200
[root@mysql sqlite-autoconf-3270200]# make && make install
3. 删除文件夹及安装包
[root@mysql ~]# rm -rf sqlite-autoconf-3270200 sqlite-autoconf-3270200.tar.gz
4. 检查安装版本
新版本
[root@mysql ~]# /usr/local/bin/sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7
旧版本
[root@mysql ~]# /usr/bin/sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668
5. 更新sqlite3
[root@mysql ~]# mv /usr/bin/sqlite3 /usr/bin/sqlite3_3.7.17
[root@mysql ~]# ln -s /usr/local/bin/sqlite3 /usr/bin/sqlite3
[root@mysql ~]# /usr/bin/sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7
6. 也可写入本地环境文件.bashrc,生效:
export LD_LIBRARY_PATH="/usr/local/lib"