如何将Python中的sqlite3版本从3.7.17升级到>3.8 [英] How to upgrade sqlite3 version in Python from 3.7.17 to > 3.8

查看:146
本文介绍了如何将Python中的sqlite3版本从3.7.17升级到>3.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试启动新的django应用程序但出现错误-django.core.exceptions.ImproperlyConfigured:需要SQLite 3.8.3或更高版本(发现3.7.17).

Trying to launch new django app but get error- django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).

我已经在/usr/local/bin中安装了sqlite 3.27及其版本我在这里尝试了建议的过程-如何升级sqlite3.8.2至> = 3.8.3 但没有运气

i already installed sqlite 3.27 and its in /usr/local/bin i tried suggested procedure here- How to upgrade sqlite 3.8.2 to >= 3.8.3 but no luck

[ec2-user @ ip-] $ sqlite3SQLite版本3.27.2 2019-02-25 16:06:06输入".help"作为使用提示.连接到瞬时内存数据库.使用".open FILENAME"在持久数据库上重新打开.sqlite>

[ec2-user@ip-]$ sqlite3 SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite>

但是当我执行python3 manage.py迁移或运行服务器时,我得到

but when i do python3 manage.py migrate or runserver i get

提高ImproperlyConfigured('需要SQLite 3.8.3或更高版本(已找到%s).'%Database.sqlite_version)

raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version)

我希望django2采用/usr/local/bin中的可执行sqlite3版本的路径.

I expect for django2 to take path of executable sqlite3 version that is sitting in /usr/local/bin.

推荐答案

尝试一下,绝对可以.它正在 Amazon Linux 2 AMI 上运行:

Try this, it definitely works. It's working on Amazon Linux 2 AMI :

wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-sqlite-sqlite-3.8.5-3.el7.art.x86_64.rpm
sudo yum localinstall atomic-sqlite-sqlite-3.8.5-3.el7.art.x86_64.rpm
sudo mv /lib64/libsqlite3.so.0.8.6{,-3.17}
sudo cp /opt/atomic/atomic-sqlite/root/usr/lib64/libsqlite3.so.0.8.6 /lib64

检查版本是否已更改:

C:\Users\teamspirit>python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> sqlite3.sqlite_version
'3.8.5'

这篇关于如何将Python中的sqlite3版本从3.7.17升级到>3.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆