2

我正在尝试构建一个 python 项目,但我遇到了 setuptools 的版本冲突错误。我收到以下错误消息:

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 1942, in main
    getattr(buildout, command)(args)
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 463, in install
    self._load_extensions()
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 998, in _load_extensions
    ep.load()(self)
  File "/Users/raul/PhpstormProjects/clients/ceres/test/ceres/eggs/buildout.eggtractor-0.6-py2.6.egg/buildout/eggtractor/tractor.py", line 68, in install
    part_names = [n for n in buildout['buildout']['tractor-target-parts'].split() if n in buildout]
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/UserDict.py", line 105, in __contains__
    return self.has_key(key)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/UserDict.py", line 100, in has_key
    value = self[key]
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 1094, in __getitem__
    options._initialize()
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 1198, in _initialize
    self.initialize()
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 1204, in initialize
    recipe_class = _install_and_load(reqs, 'zc.buildout', entry, buildout)
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/buildout.py", line 1158, in _install_and_load
    allow_hosts=buildout._allow_hosts
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/easy_install.py", line 812, in install
    return installer.install(specs, working_set)
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/easy_install.py", line 653, in install
    self._maybe_add_setuptools(ws, dist)
  File "/project/eggs/zc.buildout-2.2.0-py2.6.egg/zc/buildout/easy_install.py", line 595, in _maybe_add_setuptools
    if ws.find(requirement) is None:
  File "/Library/Python/2.6/site-packages/pkg_resources.py", line 515, in find
    raise VersionConflict(dist,req)     # XXX add more info
VersionConflict: (setuptools 0.8 (/Library/Python/2.6/site-packages/setuptools-0.8-py2.6.egg), Requirement.parse('setuptools==0.6c11'))

此错误类似于此处讨论的错误:如何在 bin/python bootstrap.py -d 期间解决 pkg_resources.VersionConflict 错误

主要区别在于我的错误告诉我从版本 0.8 降级到 0.6cll,而链接帖子中的错误需要升级才能解决错误。

还要注意语句:Requirement.parse('setuptools==0.6c11')。即使安装了较新的版本,这似乎也需要完全匹配并导致错误。

事实上,我已经尝试降级到 0.6c11 版本,并且收到以下错误消息:

Error: There is a version conflict.
We already have: setuptools 0.6c11
but distribute 0.7.3 requires 'setuptools>=0.7'.
but zc.buildout 2.2.0 requires 'setuptools>=0.7'.

所以看起来有些东西需要setuptoos==0.6c11,而另一种东西需要setuptools>=0.7。我很确定我不能同时满足这两个要求。

我正在尝试在 Mac OsX 10.7 上设置开发环境并使用 Python 2.6 版(项目需要)。知道如何解决这个问题吗?

任何帮助都会非常受欢迎。

4

1 回答 1

2

我能够解决这个问题并发布解决方案,以防有人遇到同样的问题。

原来问题是使用Xcode Dev Tools自带的python 2.6版本引起的。这个版本的python坚持setuptools 0.6c11版本。由于我正在安装的应用程序(Plone CMS)中的其他内容需要 setuptools>=0.7 版本,因此我无法使用 Mac 提供的 Python 版本。

相反,我从源代码安装了 python 2.6 的替代版本(可在此处获得:http: //www.python.org/download/releases/2.6.7/)。我使用了新安装的 python 版本,并且能够成功运行 bootstrap.py 脚本。

于 2013-10-01T18:58:03.993 回答