"Interpreter not initialized (version mismatch?)"

Gerson Kurz gerson.kurz at t-online.de
Wed Aug 15 04:40:08 EDT 2001


On 14 Aug 2001 02:34:45 -0700, jlcolom at hotmail.com (Josep L. Colom)
wrote:

>Hello,
> 
>Under Windows 2000, I've written a extension module in C++ (Visual C++
>6.0) and I've used the last stable SWIG version (1.3.6, from july
>2001).
>I'm using python 2.1.1.
> 
>Then, when I try to import the DLL (extension module) I get the error:
>    "Interpreter not initialized (version mismatch?)"

Assuming you did call Py_Initialize(), this error can come if you try
to call a python method from a different (NT native) thread. For
example, you have a python method that gets a callback, and you want
to issue it later from a different thread -> you'll have to initialize
the interpreter for that thread first. 

Getting threads to work with the python runtime seems one of the least
documented areas in C/Python :(




More information about the Python-list mailing list