[Answered ]-Pycharm debugger "waiting for connections" but running still working

1👍

To whomever else it might help, the problem in my case was that I attempted to use the debugger coupled with a run inside a Docker container functionality.

I also happened to have all ports published on that container which prevented the debugger to connect. Publishing only ports I actually needed, resolved the problem.

0👍

Check the running ports on your machine. In my case, the port that PyCharm wanted to use for debugging (127.0.0.1:xxxx) was being used by another program on my laptop.

You can check the running ports using the following command on mac:

lsof -i -P | grep -i "listen"

Or, the following command once you know which port PyCharm is trying to use (usually you can see that on top of the console tab of PyCharm after starting debugging process):

sudo lsof -i :xxxxx

After running that, you should see a list with PID numbers, names of program etc. Then you can kill the running process on that port using the PID:

sudo kill -9 PID

Or, just restart your computer.

If that doesn’t work, then it might be due to using already-existing Python module names. Make sure the names of the Python files in your project isn’t the same as any other library/code from python.

Leave a comment