bin/python bootstrap.py -d 期间如何解决pkg_resources.VersionConflict错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17586987/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve pkg_resources.VersionConflict error during bin/python bootstrap.py -d
提问by Python Team
I am tring to create a new plone environment using python plone-devstart.py tool. I got a bootstrap error. So i used a command bin/python bootstrap.py -d from my project directory. It(bin/python bootstrap.py -d command) worked fine before But now i got an error like
我正在尝试使用 python plone-devstart.py 工具创建一个新的 plone 环境。我收到引导错误。所以我从我的项目目录中使用了命令 bin/python bootstrap.py -d 。它(bin/python bootstrap.py -d 命令)之前工作正常但现在我得到了一个错误
oomsys@oomsysmob-6:~/demobrun$ bin/python bootstrap.py -d
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-
0.6.49.tar.gz
Extracting in /tmp/tmpDqVwYA
Now working in /tmp/tmpDqVwYA/distribute-0.6.49
Building a Distribute egg in /tmp/tmpv4Bzyv
/tmp/tmpv4Bzyv/distribute-0.6.49-py2.7.egg
Traceback (most recent call last):
File "bootstrap.py", line 118, in <module>
ws.require('zc.buildout' + VERSION)
File "build/bdist.linux-i686/egg/pkg_resources.py", line 698, in require
File "build/bdist.linux-i686/egg/pkg_resources.py", line 600, in resolve
pkg_resources.VersionConflict: (setuptools 0.6c11 (/home/oomsys/demobrun
/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg),
Requirement.parse('setuptools>=0.7'))
采纳答案by Martijn Pieters
You have the distribute
fork of setuptools
installed in your site packages, but your bootstrap.py
is trying to install buildout
2.2.0, which uses the new mergedsetuptools
0.7 or newer egg.
您在站点包distribute
中setuptools
安装了fork ,但您bootstrap.py
正在尝试安装buildout
2.2.0,它使用新合并的setuptools
0.7 或更新的蛋。
The distribute
fork of setuptools
was merged back into the setuptools
project and the transition is causing some pain.
的distribute
forksetuptools
被合并回setuptools
项目中,转换造成了一些痛苦。
Your options are:
您的选择是:
Tell bootstrap
to use an earlier zc.buildout
version
告诉bootstrap
使用早期zc.buildout
版本
Run bootstrap.py
with the -v
option, forcing it to stick to a specific, earlier version:
bootstrap.py
使用该-v
选项运行,强制它坚持使用特定的早期版本:
$ bin/python bootstrap.py -d -v 2.1.1
Version 2.1.1 of buildout will not upgrade itself to 2.2 or newer and works with your distribute
-supplied setuptools
egg.
buildout 的 2.1.1 版本不会将自身升级到 2.2 或更新版本,并且可以与您distribute
提供的setuptools
蛋一起使用。
Uninstall the old distribute
egg
卸载旧distribute
蛋
Manually delete all distribute*
, pkg_resources.py*
and setuptools*
files from your site-packages
directory:
从您的目录中手动删除所有distribute*
,pkg_resources.py*
和setuptools*
文件site-packages
:
$ rm -rf /home/oomsys/demobrun/lib/python2.7/site-packages/setuptools*
$ rm -rf /home/oomsys/demobrun/lib/python2.7/site-packages/distribute*
$ rm -rf /home/oomsys/demobrun/lib/python2.7/site-packages/pkg_resources.py*
and (optionally) reinstall setuptools
from with the latest ez_setup.py
; the current version is 0.9.6, and the setuptools
PyPI pagelinks you to this ez_setup.py
version.
和(可选)setuptools
使用最新版本重新安装ez_setup.py
;当前版本为 0.9.6,setuptools
PyPI 页面将您链接到此ez_setup.py
版本。
You'll also need to upgrade your bootstrap.py
script, see below.
您还需要升级您的bootstrap.py
脚本,请参见下文。
Use a recent virtualenv
使用最近的 virtualenv
Version 1.9 or newer of virtualenv
(released March 2013) lets you create a virtualenv without the setuptools
egg using the --no-setuptools
switch:
版本 1.9 或更新版本virtualenv
(2013 年 3 月发布)允许您setuptools
使用--no-setuptools
switch创建一个没有鸡蛋的 virtualenv :
$ virtualenv --no-setuptools buildout_env
Use that to create a virtual env python to run your bootstrap.py
. You still need to upgrade your bootstrap.py
too. See below.
使用它来创建一个虚拟 env python 来运行你的bootstrap.py
. 你仍然需要升级你的bootstrap.py
。见下文。
Upgrade your bootstrap.py
.
升级您的bootstrap.py
.
For zc.buildout
versions 2.2.0 and up the bootstrap.py
script has been updated to load setuptools
the-not-forked-version. Grab a new copy at from github (link to the 2 branch version), replace your old bootstrap.py
with it, and bootstrap again.
对于zc.buildout
2.2.0 及更高版本,bootstrap.py
脚本已更新以加载setuptools
非分叉版本。从 github (link to the 2 branch version) 获取一个新副本,bootstrap.py
用它替换旧的,然后再次引导。
Do make sure you removed the old forked really-distribute
-but-pretending-to-be-setuptools
egg first or run with a virtual env python that does not have that egg. See above.
请确保您确实删除了旧的分叉distribute
- 但首先假装成为setuptools
鸡蛋,或者使用没有那个鸡蛋的虚拟 env python 运行。看上面。
回答by Medhat Gayed
You could also try:
你也可以试试:
pip install --upgrade setuptools
as documented here https://askubuntu.com/questions/318824/how-to-solve-pkg-resources-versionconflict-error-during-bin-python-bootstrap-py/322701#322701