Green threads (eventlet) and debugger support

I am evaluating PyCharm and have a question about debugging and green threads. The code I'm working with uses the eventlet library. Hitting a breakpoint yields a "cannot switch to a different thread" error as the happens on a different thread. Given the popularity of green threads I suspect that this scenario must be supported, and am looking for information about how to deal with it in the debugger. Thank you,


Comment actions Permalink

I am also facing the same issue and like to know if there is any solution to this.  Not knowing much about how this works, I have tried putting the following in the $PYDEV/helpers/pydev/


        from gevent import monkey

        print("starting monkey patching>>>>>")


        print("patched all")

    except ImportError as inst:

        print ("EXCEPTION>>>>>>>>>>>>While monkey patching pydevd")



After this when I start a debug session the launch hangs with the following
/usr/bin/python2.7 /home/aswin/exes/pycharm-2.0.2/helpers/pydev/ --multiproc --client --port 54781 --file /opt/stack/nova/bin/nova-api
starting monkey patching>>>>>
[('/home/aswin/exes/pycharm-2.0.2/helpers/pydev/', 1317, '<module>', 'print repr(traceback.extract_stack())')]
patched all
pydev debugger: process 26218 is connecting.
Any help here would be hugely appreciated.
Comment actions Permalink

We have investigated this issue, and unfortunately we haven't been able to make it work. It looks like the only reasonable solution for debugging gevent applications is to use Wing IDE, which has a debugger runtime written in C and not affected by gevent's monkey-patching.


Please sign in to leave a comment.