"Stop" doesn't kill a python process


for a few days now I have the problem that PyCharm (Professional) can't really end a running process when I click the red stop button. It stops printing stuff, but it's missing the "Process finished with exit code 0" and the python process is still there. If I try to rerun the process, it hangs at "Restarting Console". (If I try to close that, it hangs at "Stopping - Restarting Console")

If I manually kill the python process, I get the "Process finished with exit code 0" and can rerun the process normally. But it's very cumbersome to close every process by hand. Can anybody help me with that?I run Ubuntu 20.04 and the project is on a separate mounted SSD. Oh and I don't have this problem with debugging.

1 comment
Comment actions Permalink

When you press stop button, PyCharm sends SIGTERM signal to the process, but the process can ignore it. The issue is most likely in the process. 

To test this, you can run the code from the terminal outside of IDE and try to send the process SIGINT and SIGTERM signals manually.

To send SIGINT, simply stop the process with Ctrl+C

To send SIGTERM, run the process, open another terminal, and do `kill -15 <pid>`


Please sign in to leave a comment.