2013-09-24 43 views
0

我在Ubuntu的精確系統上安裝了pythonbrew。在安裝過程中遇到了一些使用代理的問題(請參閱an earlier post)。現在,我能夠安裝不同版本Python和它們之間的切換,然而setuptools的蟒蛇在安裝過程中未安裝:如何將代理傳遞給pythonbrew以下載setuptools?

ERROR: Failed to install setuptools. See /usr/local/pythonbrew/log/build.log to see why. 
Skip installation of setuptools. 

的build.log包含:

Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz 
Traceback (most recent call last): 
File "distribute_setup.py", line 556, in <module> 
    sys.exit(main()) 
File "distribute_setup.py", line 552, in main 
    tarball = download_setuptools(download_base=options.download_base) 
File "distribute_setup.py", line 211, in download_setuptools 
    src = urlopen(url) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 124, in urlopen 
    return _opener.open(url, data, timeout) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 389, in open 
    response = meth(req, response) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 502, in http_response 
    'http', request, response, code, msg, hdrs) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 421, in error 
    result = self._call_chain(*args) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 361, in _call_chain 
result = func(*args) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 597, in http_error_302 
    return self.parent.open(new) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 383, in open 
    response = self._open(req, data) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 401, in _open 
    '_open', req) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 361, in _call_chain 
    result = func(*args) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 1138, in https_open 
    return self.do_open(httplib.HTTPSConnection, req) 
File "/usr/local/pythonbrew/pythons/Python-2.6/lib/python2.6/urllib2.py", line 1105, in do_open 
    raise URLError(err) 
urllib2.URLError: <urlopen error [Errno 110] Connection timed out> 

在我看來像問題是再次與代理,我不知道要修改什麼腳本,以便setuptools安裝使用我的代理。我修改了distribute_setup.py並在那裏添加了代理信息(基於this post),但是看起來每次調用pythonbrew install時都會覆蓋此文件。我是python的新手,無法找到從哪裏生成這個文件。我非常感謝任何關於如何將代理傳遞給安裝的setuptools部分的指針。

回答

0

在env中設置HTTP_PROXY和HTTPS_PROXY解決了這個特殊問題(之後錯誤從110改爲113;後續爲see this other question)。

相關問題