close

[Solved] Python [Errno 98] Address already in use

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Python [Errno 98] Address already in use in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Python [Errno 98] Address already in use Error Occurs?

Today I get the following error Python [Errno 98] Address already in use in python.

How To Solve Python [Errno 98] Address already in use Error ?

  1. How To Solve Python [Errno 98] Address already in use Error ?

    To Solve Python [Errno 98] Address already in use Error Nothing worked for me except running a subprocess with this command, before calling HTTPServer(('', 443), myHandler):

  2. Python [Errno 98] Address already in use

    To Solve Python [Errno 98] Address already in use Error Nothing worked for me except running a subprocess with this command, before calling HTTPServer(('', 443), myHandler):

Solution 1

This happens because you trying to run service at the same port and there is an already running application. it can happen because your service is not stopped in the process stack. you just have to kill those processes.

There is no need to install anything here is the one line command to kill all running python processes.

for Linux based OS:

Bash:

kill -9 $(ps -A | grep python | awk '{print $1}')

Fish:

kill -9 (ps -A | grep python | awk '{print $1}')

Solution 2

Nothing worked for me except running a subprocess with this command, before calling HTTPServer(('', 443), myHandler):

kill -9 $(lsof -ti tcp:443)

Of course this is only for linux-like OS!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read