问题: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).
解决办法:
查看当前SQLite3版本:

[root@iZwz906mxhbe3mpxy6kyzoZ myblog-python]# sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668

2.如果用了虚拟环境,查看运行环境中的SQLite3版本

[root@iZwz906mxhbe3mpxy6kyzoZ myblog-python]# workon blog
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ myblog-python]# python3
Python 3.6.5 (default, Nov  8 2019, 11:56:20) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.7.17'
>>> exit()

Centos7安装最新的sqlite3并设置更新python库版本

#回到根目录
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ myblog-python]# cd ~
#下载
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# wget https://www.sqlite.org/2019/sqlite-autoconf-3270200.tar.gz
#解压
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# tar -zxvf sqlite-autoconf-3270200.tar.gz
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# cd sqlite-autoconf-3270200
#配置安装路径
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ sqlite-autoconf-3270200]# ./configure --prefix=/usr/local
#安装
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ sqlite-autoconf-3270200]# make && make install
#查找SQLite3的路径
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ sqlite-autoconf-3270200]# find /usr/ -name sqlite3
#将下载解压的文件全删除
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ sqlite-autoconf-3270200]# cd ~
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# rm -rf sqlite-autoconf-3270200
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# rm -rf sqlite-autoconf-3270200.tar.gz 

#检查版本

最新安装的sqlite3版本

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]#  /usr/local/bin/sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7

Centos7自带的sqlite3版本

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# /usr/bin/sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668

运行环境的sqlite3版本

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# sqlite3 --version
3.7.17 2013-05-20 00:56:22 118a3b35693b134d56ebd780123b7fd6f1497668

更改旧的sqlite3

备份旧的sqlite3

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# mv /usr/bin/sqlite3  /usr/bin/sqlite3_old

将新的sqlite3软连接到原来sqlite3位置

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# ln -s /usr/local/bin/sqlite3   /usr/bin/sqlite3

运行环境的sqlite3版本

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# sqlite3 --version
3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7

将路径传递给共享库

设置开机自启动执行,可以将下面的export语句写入 ~/.bashrc 文件中,如果如果你想立即生效,可以执行source 〜/.bashrc 将在每次启动终端时执行

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# export LD_LIBRARY_PATH="/usr/local/lib"

# 检查Python的SQLite3版本
(blog) [root@iZwz906mxhbe3mpxy6kyzoZ ~]# python3
Python 3.6.5 (default, Nov  8 2019, 11:56:20) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3      
>>> sqlite3.sqlite_version    
'3.27.2'
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()

执行项目

(blog) [root@iZwz906mxhbe3mpxy6kyzoZ myblog-python]# python manage.py runserver
INFO 2019-11-09 10:27:55,169 autoreload 597 Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
November 09, 2019 - 10:27:55
Django version 2.2.5, using settings 'myblog.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

1人点赞
Django之旅
更多精彩内容,就在简书APP
作者:不爱去冒险的少年y
链接:https://www.jianshu.com/p/4586aa8e5524
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值