Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1267 closed defect (invalid)

runserver fails with pysqlite 2.1.2 on OS X (works fine with 2.0.3)

Reported by: Wilson Owned by: adrian
Component: Core (Management commands) Version: master
Severity: normal Keywords: sqlite pysqlite database
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The runserver fails on OS 10.4.4 when the DATABASE_ENGINE is set to 'sqlite3' and pysqlite 2.1.2 is installed (with the standard OS X version of Python 2.3 and sqlite3).

I can import pysqlite2 from the python interactive prompt with no errors, but runserver fails with this traceback:

python runserver
Validating models...
Unhandled exception in thread started by <function inner_run at 0x29b370>
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/", line 760, in inner_run
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/", line 744, in validate
    num_errors = get_validation_errors(outfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/", line 635, in get_validation_errors
    import django.models
  File "/Users/wminer/dev/django/src/django/models/", line 1, in ?
    from django.core import meta
  File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/django/core/meta/", line 3, in ?
    from django.core import db
  File "/Users/wminer/dev/django/src/django/core/db/", line 23, in ?
    raise ImproperlyConfigured, "Could not load database backend: %s. Is your DATABASE_ENGINE setting (currently, %r) spelled correctly? Available options are: %s" % \
django.core.exceptions.ImproperlyConfigured: Could not load database backend: dlopen(/Users/wminer/.python-eggs/pysqlite-2.1.2-py2.3-macosx-10.4-ppc.egg-tmp/pysqlite2/, 2): Symbol not found: _sqlite3_transfer_bindings
  Referenced from: /Users/wminer/.python-eggs/pysqlite-2.1.2-py2.3-macosx-10.4-ppc.egg-tmp/pysqlite2/
  Expected in: dynamic lookup
. Is your DATABASE_ENGINE setting (currently, 'sqlite3') spelled correctly? Available options are: 'ado_mssql', 'mysql', 'postgresql', 'sqlite3'

The runserver works fine with pysqlite 2.0.3, but 2.1.2 is listed as the "latest stable version" for download.

Change History (4)

comment:1 Changed 10 years ago by Gabor Farkas <gabor@…>

try this:

open a python shell, and execute this :
from pysqlite2 import dbapi2;

does that work?

comment:2 Changed 10 years ago by anonymous

It seems likely that this is because pysqlite 2.1.2 requires a newer version of sqlite.
either upgrade sqlite or use the 2.0 branch of pysqlite

comment:3 Changed 10 years ago by Wilson

  • Resolution set to invalid
  • Status changed from new to closed

Closing this because it's more likely an version compatibility issue between sqlite and pysqlite.

comment:4 Changed 10 years ago by ubernostrum

Might also try pysqlite 2.1.3, which has now been released; according to the release notes, "this branch had issues, seems to be stable now".

Note: See TracTickets for help on using tickets.
Back to Top