开发者

Python - urllib2/wget/curl doesn't connect, Mac OS X

开发者 https://www.devze.com 2023-02-19 12:02 出处:网络
The original post is at the end. I found out that this is not python specific but also curl/wget/telnet don\'t work.

The original post is at the end. I found out that this is not python specific but also curl/wget/telnet don't work.

I have now a partial solution: run everything as root.... i.e. sudo ipython and then run the example or sudo wget python.org


Hi,

I'm completely new to networks/python. I'd need to access a web page with urllib2 from my laptop (Mac Os X 10.6.6). I do this:

import urllib2
response = urllib2.urlopen('http://www.python.org/')

What I get is either: urlopen error [Errno 60] Operation timed out (at home) or开发者_开发技巧 urlopen error [Errno 51] Network is unreachable (at work).

I assume this is a problem with a firewall, unfortunately I can't figure out how to grant access to urllib2. I've allowed incoming connections for python/ipython/Python launcher in the firewall settings, but to no help...

My python is v2.6.1, urllib2 v2.6.

Thank you very much!


This has nothing to do with Python, the problem is due to your routing or firewall configuration on your network.


Found a partial solution:

running everything as root...

For now, it's OK, but if somebody knows how to solve this is, I'd still like to hear it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号