Table Of Contents

Previous topic

Database Installation

Next topic

Using a MySQL database

SQLite Database

Database info

SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine.

SQLite installation

For Python versions < 2.5, you will need the third-party pysqlite module. In Python >= 2.5, pysqlite is already integrated in the standard library as sqlite3, but it may be an older version than the current pysqlite. Make sure you have a recent version installed.

Linux

Pre-requisites:

  • You will need the sqlite C library version 3 installed. For example, on Debian/Ubuntu, install the libsqlite3 and libsqlite3-dev package.

Installation options:

  1. Use your package manager

  2. Use easy_install:

    easy_install pysqlite

Windows

Installation options:

  1. Use a windows binary installer from the pysqlite homepage.

  2. Use easy_install:

    easy_install pysqlite

Mac

For Darwin Ports:

$ sudo port install sqlite2

Known Issues

  • For multiuser applications with heavy load you should use use MySQL or PostgreSQL instead, otherwise you’ll probably often get the error “database locked”, because concurrent threads are trying to access the database for writing at the same time.

  • If you are getting this error:

    exceptions.AttributeError: "'pysqlite2.dbapi2.Connection' object has no attribute 'autocommit'"

    Please See #763 and this googlegroup discussion