Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我使用 Visual Studio 调试我的 Python C 扩展时,程序中止并显示以下消息:“PyThreadState_Get:没有当前线程”。
在 Release 中,程序运行良好,如果我添加调试信息,它仍然运行良好。
如何解决问题?
如果定义了 NDEBUG,则必须使用解释器 python_d.exe 的调试版本。
此外,如果扩展名是 myextension,则 Release 中 Dll 的名称必须是 myextension.pyd,但在 Debug 中,Dll 的名称必须是 myextension_d.pyd