Embedded python 2.6 interpreter can't "import sqlite3" on Windows XP

jdetaeye johan.de.taeye at gmail.com
Sun Feb 1 06:52:58 EST 2009


I am porting an application which embeds a Python interpreter to
Python 2.6.
On version 2.5 all is working fine, but importing the sqlite3 module
doesn't work any more on 2.6.

The statement  "import sqlite3" does work fine when executed from in
the python command prompt, ie not from the embedded interpreter.
The same import gives the following error when executed from the
embedded interpreter.
   Python stacktrace:
       Traceback (most recent call last):
         File "<string>", line 2, in <module>
         File "C:\Python26\lib\sqlite3\__init__.py", line 24, in
<module>
           from dbapi2 import *
         File "C:\Python26\lib\sqlite3\dbapi2.py", line 27, in
<module>
           from _sqlite3 import *
       ImportError: DLL load failed: A dynamic link library (DLL)
initialization routine failed.
   Windows popup window:
       Runtime Error!
       R6034
       An application has made an attempt to load the C runtime
library incorrectly.
       Please contact the application's support team for more
information.

Unfortunately the "application support team" (that is me :-) has no
idea on how to move forward on this:
a) I guess this is releated to the problem with manifest files,
already reported in http://bugs.python.org/issue4120 ?
b) What could be a solution or workaround for the problem?

All the above is on Windows XP.
Other modules with have an extension DLL (such as ssl) give exactly
the same problem.

All help appreciated,

Johan




More information about the Python-list mailing list