2017-04-24 85 views
0

在我的一台生成机器上,Python urllib不打开任何http URL,但wget或curl做得很好。另外当我用sudo运行脚本时,我没有任何错误。Python urllib不打开任何http URL

每次我得到:错误111(拒绝连接)的任何URL

#!/usr/bin/python3 
import urllib.request 
x = urllib.request.urlopen('http://pythex.org/') 
+0

定义您使用的代理与wget和卷曲? –

+0

不,我不使用 – themis

回答

0

问题是因为无效HTTP_PROXY的.bashrc中