sqlite for mac?

Daniel Nogradi nogradi at gmail.com
Thu May 3 10:37:07 EDT 2007


> > >> Does sqlite come in a mac version?
> >
> > > The interface (pysqlite) is part of the python 2.5 standard library
> > > but you need to install sqlite itself separately (as far as I
> > > remember) fromwww.sqlite.org
> >
> > http://developer.apple.com/documentation/MacOSX/Conceptual/OSX_Techno...
> >
>
> I downloaded pysqlite, ran the setup script, and tested the
> installation and everything worked fine.  However, if I try to import
> either sqlite, sqlite2, or sqlite3 into a python program, I get an
> error saying there's no such module.
>
> I assume that means pysqlite cannot see the installation of SQlite
> that came preinstalled on my mac.  My python book says to download the
> SQlite source where automatic code generation has already been
> performed.  I did that.  Then my book says says to follow the
> instructions in the README file.  However, the download only has two
> files:  sqlite3.c and sqlite3.h.  As a result, I don't know what to
> do.

If all tests ran fine then pysqlite can see your sqlite installation.
How are you importing sqlite? It's usually something like "from
pysqlite2 import dbapi2 as sqlite" not simply "import sqlite". If you
go to the test directory where everything works you can see how those
modules import it and that should definitely work for you as well.

HTH,
Daniel



More information about the Python-list mailing list