5

我想知道 sqlite3 与 python2.5、pysqlite 和apsw之间的区别?尝试使用 python2.5 在 windows vista 上安装 pysqlite 时遇到颠簸,请参见以下内容:

  1. 从http://sqlite.org/download.html下载 sqlite并将它们解压缩到windows/system32文件夹中并将 sqlite3.dll 放入c:/python25/Lib文件夹中
  2. 下载pysqlite windows 安装程序
  3. 尝试在 python shell 中运行以下命令时:

    >>> from pysqlite2 import test
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "pysqlite2\test\__init__.py", line 35, in <module>
        from pysqlite2.test import dbapi, types, userfunctions, factory, transactions,\
      File "pysqlite2\test\dbapi.py", line 27, in <module>
        import pysqlite2.dbapi2 as sqlite
      File "pysqlite2\dbapi2.py", line 27, in <module>
        from pysqlite2._sqlite import *
    ImportError: No module named _sqlite
    

我想知道任何有上述三种 sqlite 绑定到 python 的经验的人都可以评论他们的优缺点,例如性能我想知道是否值得尝试 pysqlite 或 apsw

谢谢

4

2 回答 2

3

pysqlite 与 sqlite3 相同(内置于 python 2.5 的 windows 二进制包中)

于 2010-04-09T16:27:44.613 回答
2

尽管如此,pysqlite 站点包仍然包含更多补丁。它是 2.6.0 版,而内置模块是 2.3.2 版。如果您在 pysqlite 包目录中(我在某处读过),则导入 pysqlite2.test 时可能会出现错误。

与 apsw 的区别在http://code.google.com/p/apsw上得到了最好的解释

于 2010-04-09T18:01:41.663 回答