如何在python中使用最新的sqlite3版本 [英] How to use the latest sqlite3 version in python

查看:80
本文介绍了如何在python中使用最新的sqlite3版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 Amazon Linux 中使用带有 python 的 sqlite 3.8 或更高版本.

我将我的 sqlite 安装更新到了最新版本:

$ sqlite3 -version3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2171d

我也更新了我的 pysqlite 版本

pip install --upgrade pysqlite

然而,我的 pysqlite 似乎仍然只支持 sqlite 3.7 版:

$ python>>>导入 sqlite3>>>sqlite3.version'2.6.0'>>>sqlite3.sqlite_version'3.7.17'>>>>>>从 pysqlite2 导入 dbapi2 作为 sqlite>>>sqlite.version'2.8.3'>>>sqlite.sqlite_version'3.7.17'

如何更新 sqlite python API 以支持更新版本的 sqlite?

解决方案

APSW 有非官方的 Python 轮分发版

a> 本身不在 PyPI 上发布:

<块引用>

APSW 在 Python 包索引 (pypi) 中不可用,因此无法从中安装.(一个随机的人在 APSW 名称下放了一个过时的质量差的上传.它与这个项目没有任何关系.)这样做的原因是 [...]

我假设原因早于 Python 轮子.

wheel 分发包被称为 apsw-wheels(和 GitHub 存储库).除了 PyPy 轮子之外,它对我来说效果很好.

I need to use sqlite version 3.8 or higher with python in Amazon Linux.

I updated my sqlite installation to the latest version:

$ sqlite3 -version
3.22.0 2018-01-22 18:45:57 0c55d179733b46d8d0ba4d88e01a25e10677046ee3da1d5b1581e86726f2171d

I also updated my pysqlite version

pip install --upgrade pysqlite

However, my pysqlite still only seems to support sqlite version 3.7:

$ python
>>> import sqlite3
>>> sqlite3.version
'2.6.0'
>>> sqlite3.sqlite_version
'3.7.17'
>>>
>>> from pysqlite2 import dbapi2 as sqlite
>>> sqlite.version
'2.8.3'
>>> sqlite.sqlite_version
'3.7.17'

How can I update the sqlite python API to support a newer version of sqlite?

解决方案

There's unofficial Python wheel distribution of APSW which itself doesn't release on PyPI:

APSW is not available at the Python Package Index (pypi) and hence cannot be installed from it. (A random person has put an outdated poor quality upload under the APSW name. It has nothing useful to do with this project.) The reason for this is [...]

And I assume the reason predates Python wheels.

The wheel distribution package is called apsw-wheels (and GitHub repo). It worked just fine for me except for PyPy wheels.

这篇关于如何在python中使用最新的sqlite3版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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