Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the differences among sqlite3 from python2.5, pysqlite and apsw

I would like to know the differences among sqlite3 from python2.5, pysqlite and apsw? I have a bumpy run when trying to install pysqlite on windows vista with python2.5, see following:

  1. download sqlite from http://sqlite.org/download.html and unzip them into windows/system32 folder and put sqlite3.dll into c:/python25/Lib folder
  2. download pysqlite windows installer
  3. when trying to run following in 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
    

I am wondering anybody with experiences of the above three types of sqlite binding to python can comment their pros and cons such as performances I am wondering is it worthwhile to try the pysqlite or apsw

thanks

like image 446
leo Avatar asked Apr 09 '10 16:04

leo


2 Answers

pysqlite is the same as sqlite3 (which is built in to the windows binary package for python 2.5)

like image 108
newtover Avatar answered Oct 19 '22 01:10

newtover


Still, the pysqlite site-package includes more patches. It is version 2.6.0 whereas the built-in module is version 2.3.2. The error when importing pysqlite2.test may occur if you are in the pysqlite package directory (i've read somewhere).

The difference with apsw is best explained on http://code.google.com/p/apsw

like image 43
user311034 Avatar answered Oct 19 '22 01:10

user311034