生成Python项目时出现Setuptools版本冲突错误

生成Python项目时出现Setuptools版本冲突错误,python,setuptools,Python,Setuptools,我试图构建一个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",

我试图构建一个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'))
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'.
此错误与此处讨论的错误类似:

关键的区别是,我的错误告诉我从0.8版降级到0.6cll版,而链接帖子中的错误需要升级才能解决错误

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

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

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'))
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。我很确定我不能同时满足这两个要求

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


非常欢迎任何帮助。

我能够解决此问题,并且正在发布解决方案,以防有人遇到同样的问题

事实证明,这个问题是由使用Xcode开发工具附带的Python2.6版本引起的。此版本的python坚持使用setuptools版本0.6c11。由于我正在安装的应用程序(Plone CMS)中的其他内容需要setuptools>=0.7版本,因此我无法使用Mac提供的Python版本

相反,我从源代码处安装了python 2.6的另一个版本(可在此处获得:)。我使用了新安装的python版本,并且能够成功地运行bootstrap.py脚本