Re: Correctly Importing SQLite3 in Python-2.5

Adrian Klaver <[email protected]>
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
On Sunday 11 November 2007 4:54 pm, Rich Shepard wrote:
>    I recall reading that SQLite3 is built into Python-2.5 now, so instead
> of writing 'from pysqlite2 import dbapi2 as sqlite3' we write 'import
> sqlite3'. But, that's not working here. The error I see is:
>
> Traceback (most recent call last):
>    File "eikos.py", line 3, in <module>
>      import wx, serial, os, config, functions, sqlite3
>    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
>
>    What is the correct syntax?
>
> TIA,
>
> Rich
The import syntax is right. For some reason it is not finding the _sqlite3.so 
module. In my installation of Python 2.5 it is 
in  /usr/lib/python2.5/lib-dynload/. You may have a PATH problem where Python 
is looking in the path of an older version.

-- 
Adrian Klaver
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.