问题
Somehow my pycharm
debugger doesn't connect anymore.
I tested all ENV. Also, reading up on it on stackoverflow: I deleted the .idea directory.
However, after restarting the pycharm .idea is always recreated (deleted caches and even deleted&downlaoded pycharm again)
**/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 52281 --file /Users/franzi/Desktop/i18n/qordoba-cli/qordoba/cli.py i18n-find --traceback
warning: Debugger speedups using cython not found. Run '"/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6" "/Applications/PyCharm CE.app/Contents/helpers/pydev/setup_cython.py" build_ext --inplace' to build.
pydev debugger: process 96448 is connecting
Connected to pydev debugger (build 171.4694.67)
Could not connect to 127.0.0.1: 52282
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 1583, in <module>
debugger.connect(host, port)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 324, in connect
self.initialize_network(s)
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydevd.py", line 316, in initialize_network
time.sleep(0.1) # give threads time to start
KeyboardInterrupt
Process finished with exit code 1**
回答1:
I had similar problem. I have removed (remove, not disable) all existing breakpoints (in the dialog box invoked by Ctrl+Shift+F8). After removing all breakpoints and modifying run configuration (disable add content roots and add source roots to PYTHONPATH) debugging started to work. Enabling them back and still working fine - problem gone.
I think that removing breakpoints will be sufficient to solve the issue. See hint from JetBrains community: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000014004/comments/115000239630
来源:https://stackoverflow.com/questions/45109515/pycharm-debugger-not-connecting-keyboardinterrupt