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

import sqlite3

I get

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/lib/python2.5/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named _sqlite3

And I thought that's normal, there is no Python module called sqlite3. 

Then, after a discussion in the Gentoo forum, I saw this in the Python
library reference:

> To use the module, you must first create a Connection object that
represents the database. Here the data will be stored in the /tmp/example
file: 
> 
> conn = sqlite3.connect('/tmp/example')
> 

No import statement, though, so the module might have been renamed in that
statement. Possibly not a really good idea in the documentation. 

But now I see an old post to c.p.l:

> I'm using Ubuntu Feisty: 
>  * Python 2.5.1 (r251:54863, May  2 2007, 16:56:35) 
>          [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 
>  * SQLite version 3.3.13 
>  
> 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?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to