During development I often end up with multiple live sessions. PyCharm gives me an option to close all debugger tabs (or all other tabs), but for each live session it brings up
I ran into this issue when using PyCharm for the first time. I assumed incorrectly that each time I ran the debugger, I was killing any existing run and starting a new one. I found no apparent way in the GUI to kill all of the python processes with open debugger connections, so I just did it in the terminal as follows:
Find the processes you're debugging. In my case, I had over 100 processes before I realized what was going on. Just eyeball it to ensure correctness.
ps ux | grep my_script_name | grep -v grep
Send your list of PIDs to kill
(assuming PID is column 2 in your ps output):
kill -9 `ps ux | grep my_script_name | grep -v grep | awk '{print $2}'`
Try closing the tabs in PyCharm. Debugger connections are closed, so it won't complain.