import pysqlite2 or import sqlite3?

Hertha Steck nulla.epistola at web.de
Wed Nov 21 15:11:59 EST 2007


Hertha Steck 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
> 
> 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.
> 

After a second look at the error message: when I installed Gentoo, Python
2.4 was installed, I got the new version a little later. And I think I
installed Pysqlite 2.3.5 separately. 

Python 2.5 comes with pysqlite - should I uninstall my version?





More information about the Python-list mailing list