• 欢迎光临~

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

开发技术 开发技术 2022-05-24 次浏览

背景

查看python版本:
django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17)

查看Django版本:
django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17)

问题描述

Django 项目中运行出现如下问题:

Django-django.core.exceptions.ImproperlyConfigured: SQLite 3.9.0 or later is required (found 3.7.17)

问题解决

实际就是需要安装一个高版本 Sqlite

  1. 下载源码包
    也可以到官网上找合适的版本 https://www.sqlite.org/index.html

  2. 更新版本

cd /usr/local/src
wget https://www.sqlite.org/2022/sqlite-autoconf-3380500.tar.gz --no-check-certificate
tar -zxvf sqlite-autoconf-3380500.tar.gz
cd sqlite-autoconf-3380500.tar.gz
./configure --prefix=/usr/local/sqlite
make && make install

如果在下载资源中报错:
警告: 无法验证 www.sqlite.org 的由 “/C=US/O=Let's Encrypt/CN=R3” 颁发的证书:颁发的证书已经过期。
解决办法:

wget https://www.sqlite.org/2022/sqlite-autoconf-3380500.tar.gz --no-check-certificate
  1. 替换旧的版本:
mv /usr/bin/sqlite3 /usr/bin/sqlite3_bak
cd /usr/local/sqlite/bin/
ln -s sqlite3 /usr/bin/sqlite3
  1. 根据sql安装路径填写,并让配置生效:
[root@test ~] vim /etc/profile
#添加内容
export LD_LIBRARY_PATH="/usr/local/sqlite/lib"
[root@test ~]source /etc/profile

参考链接:
查看Django版本:https://blog.csdn.net/alwaysbefine/article/details/105956783
参考:https://mankel.blog.csdn.net/article/details/120273460?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2~default~CTRLIST~Rate-1-120273460-blog-123026417.pc_relevant_antiscanv3&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2~default~CTRLIST~Rate-1-120273460-blog-123026417.pc_relevant_antiscanv3&utm_relevant_index=1

喜欢 (0)