PySQLite ... does not define uinit function... Help

Gerhard Haering gerhard.haering at gmx.de
Tue Mar 18 04:25:33 EST 2003


* John Hall <wweexxsseessssaa at telusplanet.net> [2003-03-18 02:48 +0000]:
> On Tue, 18 Mar 2003 02:21:56 GMT, John Hall:
> 
> >I'm trying to set up SQLite & PySQLite have the following problem,
> >would appreciate some help. TIA
> >
> >When my prog encounters
> >
> >import sqlite
> >
> >I get
> >Import error: dynamic module does not define init function
> >(initsqlite)
> >
> 
> OOPS. Sorry, guys, it's been a fragmented day
> 
> I just realised the problem is not with PySQLite, but the sqlite.dll
> and its .def file. I need to contact the SQLite author.

No need to contact the SQLite author.

If you do "import sqlite" Python tries a few different files in a certain
order. I don't remember the exact order, but on Windows, all of

sqlite.py
sqlite/__init__.py
sqlite.dll
sqlite.pyd

are in the list of imports that will be tried.

The problem is now that in the presence of sqlite.dll, we have both sqlite.dll
and sqlite/__init__.py which apparently is problematic.

Just move the sqlite.dll out of the Python module search path (sys.path) and
you'll be fine.

The Windows version of PySQLite is statically linked against SQLite, so there
is no need to put any sqlite.dll's anywhere. The only thing you can install
(it's still optional) are the mxExtensions in order to have better support for
Date, Time, DateTimeDelta, etc. (through mxDateTime).

HTH,

-- Gerhard





More information about the Python-list mailing list