2017-04-24 30 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中