1,105,409 Community Members

socket error: connection refused

Member Avatar
AnjaliThukral
Newbie Poster
5 posts since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

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.

Member Avatar
jrcagle
Practically a Master Poster
608 posts since Jul 2006
Reputation Points: 77 [?]
Q&As Helped to Solve: 160 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
AnjaliThukral
Newbie Poster
5 posts since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks Jeff I will try that!
Anjali.

Member Avatar
OLer94
Newbie Poster
7 posts since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
AnjaliThukral
Newbie Poster
5 posts since Sep 2007
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
zachabesh
Junior Poster
106 posts since Jun 2008
Reputation Points: 5 [?]
Q&As Helped to Solve: 17 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
tyincali
Light Poster
45 posts since Oct 2008
Reputation Points: 21 [?]
Q&As Helped to Solve: 8 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
Stefano Mtangoo
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 441 [?]
Q&As Helped to Solve: 394 [?]
Skill Endorsements: 2 [?]
 
0
 

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

Member Avatar
Bangmaker
Newbie Poster
1 post since Feb 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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?

Member Avatar
xXLOLXx
Newbie Poster
1 post since Aug 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
Stefano Mtangoo
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 441 [?]
Q&As Helped to Solve: 394 [?]
Skill Endorsements: 2 [?]
 
0
 

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

Member Avatar
bryceson
Newbie Poster
2 posts since Jun 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
bryceson
Newbie Poster
2 posts since Jun 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
vegaseat
DaniWeb's Hypocrite
6,984 posts since Oct 2004
Reputation Points: 1,544 [?]
Q&As Helped to Solve: 1,872 [?]
Skill Endorsements: 67 [?]
Moderator
 
0
 

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.

Question Answered as of 2 Years Ago by bryceson, Stefano Mtangoo, Bangmaker and 6 others
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article