Arash Saidi Arash Saidi -5 years ago 424
Python Question

Flask and Pycharm socket.error

I am running Flask in Pycharm. Suddenly I can no longer run the framework properly! I get a bunch of error messages that ends with:

socket.error: [Errno 48] Address already in use

It seems like the socket Flask is using:


And it is somehow not available anymore because the last runtime was not shut down properly. I can probably restart my computer and it will probably be a solution, but I don't want to do that if it happens regularly. How do I shut it down?

Answer Source

If you're running Linux, do a ps aux | grep python and kill the process that is running flask. If you're running windows, open task manager and kill the python process running flask, but you might have to kill PyCharm.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download