I have windows xp operating system at my home with python 2.5 and same operating system with python 2.4 at my computer lab. While working in python IDLE suddenly this error message --socket error:connection refused-- pops up and then python IDLE does not work at all.To make it work again i have to reinstall it.
Is there any other solution to this problem. Please let me know.

reinstall! Wow. I've gotten that message before, but rebooting is the most extreme solution to date for me.

It may be the case that your firewall is blocking connections to IP address 127.0.0.1, the internal loopback that Python uses.

If so, you can go into Symantec/Norton/McCaffee/whatever and enable Python on that address.

Hope that helps,
Jeff

Thanks Jeff I will try that!
Anjali.

Ive had that happen to me. What you can do is go to your task manager and under "processes" close all python software then re-open.

I had to reinstall twice before I figured that out.

I am not finding any place in symantec antivirus to put that ip address.
Although i disabled it all together, and it worked.
But still want to do that u said earlier.
waiting for answer, thanks!
Anjali.

This is lame! Is there a better free IDE? I'm sick of IDLE's issues.

If you are stuck on windows, check out Notepad++

Free IDE? Many
Wing IDE 101 - but reduced features
Drpython - No debugging
PyScripter
Netbeans with Nbpython
Eclipse with pydev plugin
Eric (Make sure you take care of Qt licence)............etc

I have had this problem with version 2.5, 2.6, and 3.0. I have uninstalled and reinstalled several times but IDLE is still not working. The error popup reads "Socket Error: A socket operation was attempted to an unreachable network." IDLE does not work with the firewall turned off. Any suggestions?

Hey guys
I've had the same problem and by looking at lots of different ways to solve the problem i have found the solution. I'm not sure on the specific reasons and stuff but basically, the error only pops up if you had not ended the "while" command. So i think the code keeps repeating in that socket or something. Just remember before you close the python window when you go to test your code, write a code to end the "while" command.(it will tell you that the program is still running and if you want to kill it)
:P

Hey guys
I've had the same problem and by looking at lots of different ways to solve the problem i have found the solution. I'm not sure on the specific reasons and stuff but basically, the error only pops up if you had not ended the "while" command. So i think the code keeps repeating in that socket or something. Just remember before you close the python window when you go to test your code, write a code to end the "while" command.(it will tell you that the program is still running and if you want to kill it)
:P

More than year old thread Lol!

Use VIDLE that comes with VPython or alternatives already mentioned

Hi, I am also having refused connection errors. im kind of new to forums, but i will try and be as detailed and clear about my problem as possible. I am making a CLI for a project. It starts by connecting to a basic authenticated web address. This works and no errors are brought up. in fact the socket connection part (that i am getting the error at) compiles and runs without error twice in the authentication process. I then send the authenticated header to a connection.request("POST", "url", request, header) along with the other necessary info. When this happens python exits and states "socket.error: [Errno 111] Connection refused". This doesnt make sense to me and when tracing back through the code I cant find anything that causes this. Especially since it had worked twice before. I posted the relevant code below with some changed words (nothing that would cause a discrepancy; just to protect my project). Any help or suggestions are welcome and greatly appreciated.

Basic Authentication:
http://code.activestate.com/recipes/305 ... ntication/
with the exception at the end:
header = {"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Authorization": authheader} # makes the header dictionary
return header

connection request:
header = connector(username, password, IP) # this is the above basic authentication method
request = json.dumps({"jsonrpc": "2.0", "method": "DoThis", "params": params, "id": ID})
CLI.connection.request("POST", "/json-rpc/1.0", request, header)

the last line is where it fails to that error... also none of it failed till i added the header in the last line.

Sorry for the length of the problem, its the only way i could have conveyed the problem clearly.
Thank you,
Bryce

After looking through it, i found that the connection is not constant. meaning even though i connected to the basic authenticated web address, the connection fell through after and the authentication was no longer valid. In order to get the data to the web address, i found that i had to use the basic authentication like i had, but I had to change the following line:
req = urllib2.Request(theurl)..... to...... req = urllib2.Request(theurl, requested)
where requested is the data set i was trying to send to the web address. Simple yet complicated fix.

Hope this helps others,
Bryce

After looking through it, i found that the connection is not constant. meaning even though i connected to the basic authenticated web address, the connection fell through after and the authentication was no longer valid. In order to get the data to the web address, i found that i had to use the basic authentication like i had, but I had to change the following line:
req = urllib2.Request(theurl)..... to...... req = urllib2.Request(theurl, requested)
where requested is the data set i was trying to send to the web address. Simple yet complicated fix.

Hope this helps others,
Bryce

Thanks for letting the rest of us know your findings.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.