Debugging my Python C extension lead to "PyThreadState_Get: no current thread"

327 Views Asked by At

When I Debug my Python C extension using Visual Studio the program abort with the message: "PyThreadState_Get: no current thread".

In Release the program works fine and if I add debugging information it still works fine.

How to solve the problem?

1

There are 1 best solutions below

0
On

If NDEBUG is defined you have to use the Debug version of the interpreter python_d.exe.

Furthermore if the name of the extension is myextension the name of the Dll in Release must be myextension.pyd but in Debug the name of the Dll must be myextension_d.pyd