V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
daiv
V2EX  ›  Python

如何升级 sqlite (python自带的 )

  •  
  •   daiv · 2013-12-20 12:52:35 +08:00 · 8489 次点击
    这是一个创建于 3790 天前的主题,其中的信息可能已经有所发展或是发生改变。
    请问如何升级 python 自带的 sqlite的版本呢? (Google没查到方法呀)

    想升级到 3.7以上,使用 WAL模式。

    谢谢 ^_^

    ----------------------------------------------------------------------------
    Python 2.7.5
    >>> import sqlite3
    >>> sqlite3.sqlite_version
    '3.6.21'
    >>>
    第 1 条附言  ·  2013-12-20 15:28:27 +08:00
    最新 sqlite都是 3.8.2

    我们用的 3.6, 3.7 感觉没什么区别?
    也很少人提升级呀?

    为什么?
    11 条回复    1970-01-01 08:00:00 +08:00
    clino
        1
    clino  
       2013-12-20 12:58:14 +08:00   ❤️ 1
    升级linux是一个方法,heihei,比如我现在用12.04
    >>> sqlite3.sqlite_version
    '3.7.9'

    要不就是编译安装新版本的python了
    daiv
        2
    daiv  
    OP
       2013-12-20 13:03:27 +08:00
    @clino linux下面好办,好像重新编译安装一下就好。win 环境呢?
    VYSE
        3
    VYSE  
       2013-12-20 13:12:51 +08:00   ❤️ 1
    替换PYTHON27/DLL/sqlite3.dll,想哪个就哪个
    daiv
        4
    daiv  
    OP
       2013-12-20 14:00:01 +08:00
    @VYSE 替换以后,出错啦:ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。

    难道是因为我的 win7 是 64位的?
    daiv
        5
    daiv  
    OP
       2013-12-20 14:05:46 +08:00
    @VYSE 只好google查找了一下,官网没有看到 64bit 的 dll文件。。。
    BOYPT
        6
    BOYPT  
       2013-12-20 14:39:17 +08:00   ❤️ 1
    自己重新编译一次python。
    VYSE
        7
    VYSE  
       2013-12-20 15:19:00 +08:00   ❤️ 1
    @daiv 源文件复制进Python源代码,只编译sqlite项目即可
    daiv
        8
    daiv  
    OP
       2013-12-20 15:30:21 +08:00
    @BOYPT @VYSE 已经重新编译了,编译好了以后就可以其他机器用。

    不知道为什么,很少提到 sqlite3 的升级,现在都 3.8.2了。我们好像还经常用 3.6 3.7
    lovesky
        9
    lovesky  
       2013-12-20 15:58:08 +08:00   ❤️ 1
    另外可以关注一下apsw

    https://code.google.com/p/apsw/
    daiv
        10
    daiv  
    OP
       2013-12-20 16:34:35 +08:00
    @lovesky 好东西,很全呀。下载了。谢谢。我现在直接 dropbox里面收集 dll
    109109
        11
    109109  
       2013-12-21 02:04:14 +08:00
    windows:
    http://www.sqlite.org/download.html
    载win版本替换sqlite3.dll, (还需要 _sqlite3.pyd 复制别机.

    Python 2.7.5
    >>> import sqlite3
    >>> sqlite3.sqlite_version
    '3.8.2'


    ARM:
    复制别的机上的 _sqlite3.so

    Python 2.7.3
    >>> import sqlite3
    >>> sqlite3.sqlite_version
    '3.7.12.1'

    ARM的我没找工具链编译..
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1175 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:22 · PVG 02:22 · LAX 11:22 · JFK 14:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.