close

[Solved] Python ConnectionRefusedError: [Errno 61] Connection refused

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Python ConnectionRefusedError: [Errno 61] Connection refused 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 ConnectionRefusedError: [Errno 61] Connection refused Error Occurs?

Today I get the following error Python ConnectionRefusedError: [Errno 61] Connection refused in python.

How To Solve Python ConnectionRefusedError: [Errno 61] Connection refused Error ?

  1. How To Solve Python ConnectionRefusedError: [Errno 61] Connection refused Error ?

    To Solve Python ConnectionRefusedError: [Errno 61] Connection refused Error '127.0.0.1' means local computer – so client connents with server on the same computer. Client have to use IP from server – like 192.168.0.1.

  2. Python ConnectionRefusedError: [Errno 61] Connection refused

Solution 1

This may not answer your original question, but I encountered this error and it was simply that I had not starting the server process first to listen to localhost (127.0.0.1) on the port I chose to test on. In order for the client to connect to localhost, a server must be listening on localhost.

Solution 2

'127.0.0.1' means local computer – so client connents with server on the same computer. Client have to use IP from server – like 192.168.0.1.

Check on server:

on Windows (in cmd.exe)

ipconfig

on Linux (in console)

ifconfig

But if you are in different networks then it may not work. ipconfig/ifconfig returns local IP (like 192.168.0.1) which is visible only in local network. Then you may need external IP and setting (redirections) on your and provider routers. External IP can be IP of your router or provider router. You can see your external IP when you visit pages like this http://httpbin.org/ip . But it can still need some work nad it be bigger problem.

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