【问题标题】:Debugging my Python C extension lead to "PyThreadState_Get: no current thread"调试我的 Python C 扩展会导致“PyThreadState_Get:没有当前线程”
【发布时间】:2015-03-02 08:30:37
【问题描述】:

当我使用 Visual Studio 调试我的 Python C 扩展时,程序中止并显示以下消息:“PyThreadState_Get:没有当前线程”。

在 Release 中,程序运行良好,如果我添加调试信息,它仍然运行良好。

如何解决问题?

【问题讨论】:

    标签: python pycxx


    【解决方案1】:

    如果定义了 NDEBUG,则必须使用解释器 python_d.exe 的调试版本。

    此外,如果扩展名是 myextension,则 Release 中的 Dll 名称必须是 myextension.pyd,但在 Debug 中,Dll 的名称必须是 myextension_d.pyd

    【讨论】:

      猜你喜欢
      • 2018-06-15
      • 2017-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-12
      相关资源
      最近更新 更多