import pysqlite2 or import sqlite3?

Hertha Steck nulla.epistola at web.de
Sun Nov 25 04:56:40 EST 2007


Mike MacDonald wrote:

> On Nov 21, 3:02 pm, Hertha Steck <nulla.epist... at web.de> wrote:
>> Hello,
>>
>> I'm using Python 2.5.1, Pysqlite 2.3.5 and SQLite 3.4.1 on Gentoo Linux.
>> I've always imported pysqlite using
>>
>> from pysqlite2 import dbapi2
>>
>> and that works. If I try
>>

...
>> > Suppose I run the following program:
>> >  import sqlite3
>>
>> > conn = sqlite3.connect('example')
>>
>> ...
>>
>> And from the rest of the posting that import seems to work. Has that
>> module different names for different Linux distributions? Or what's the
>> matter here?
> 
> Make sure you built python with the "sqlite" USE flag.

That was it. I had used the "sqlite3" USE flag, but for python "sqlite" is
needed. And removing pysqlite didn't harm anything.




More information about the Python-list mailing list