引入

在使用 PyCharm 进行 Debug 时,程序会卡死,并显示 unable to display frame variables 问题

查找

逐步查找后发现程序中使用的 gevent ,PyCharm 默认关闭 gevent 的调试,通过在设置中开启 Gevent compatible , 如图:

gevent_compatible

官方描述

官方链接

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Gevent debug support

Posted on August 20, 2012 by Dmitry Trofimov
Good news for everyone who uses gevent!

Since the last PyCharm 2.6 EAP our visual debugger is able to deal with gevent monkey-patched code.

To enable it just edit python/helpers/pydev/pydevd_constants.py in PyCharm installation and set the constant SUPPORT_GEVENT=True

Your feedback is welcome as always!

Update: In recent versions of PyCharm, the option has moved to the main settings dialog. You can enable it under Settings | Python Debugger | Gevent compatible debugging.