安装 python setuptools 时出错

安装 python setuptools 时出错

ez_Setup.py这里

我在 CentOS 6 上有 python 2.6。

当我这样做时:

python ez_setup.py

我一直收到这个错误:

Downloading http://cheeseshop.python.org/packages/2.6/s/setuptools/setuptools-0.6a8-py2.6.egg
Traceback (most recent call last):
  File "ez_setup.py", line 214, in <module>
    main(sys.argv[1:])
  File "ez_setup.py", line 147, in main
    egg = download_setuptools(version, to_dir=tmpdir, delay=0)
  File "ez_setup.py", line 128, in download_setuptools
    src = urllib2.urlopen(url)
  File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 616, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.6/urllib2.py", line 435, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.6/urllib2.py", line 518, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

答案1

我尝试访问时遇到了同样的错误http://cheeseshop.python.org/packages/2.6/s/setuptools/setuptools-0.6a8-py2.6.egg,该文件不存在。但是,有

安装工具-0.6c11-py2.6.egg
安装工具-0.6c10-py2.6.egg
安装工具-0.6c9-py2.6.egg

可用的,因此如果你手动下载并安装最后一个(安装工具-0.6c11-py2.6.egg)它就会起作用。

我注意到的另一个问题是,ez_setup.py我从您提供的 URL 下载的脚本(通过下载正确的脚本可以完美运行setuptools-0.6c11-py2.6.egg)与您在问题中提供的错误行不符,也许您拥有的脚本是旧版本,只需重新下载并尝试重新启动它。

相关内容