bin/python bootstrap.py -d 期间如何解决pkg_resources.VersionConflict错误 [英] How to solve pkg_resources.VersionConflict error during bin/python bootstrap.py -d

查看:35
本文介绍了bin/python bootstrap.py -d 期间如何解决pkg_resources.VersionConflict错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 python plone-devstart.py 工具创建一个新的 plone 环境.我收到引导错误.所以我从我的项目目录中使用了命令 bin/python bootstrap.py -d .它(bin/python bootstrap.py -d 命令)之前运行良好但现在我遇到了类似

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

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'))

推荐答案

您的站点包中安装了 distribute 分支 setuptools,但是您的 bootstrap.py 正在尝试安装 buildout 2.2.0,它使用新的 merged setuptools 0.7 或更新的 Egg.

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 merged setuptools 0.7 or newer egg.

setuptoolsdistribute fork 被合并回 setuptools 项目,这种转变造成了一些痛苦.

The distribute fork of setuptools was merged back into the setuptools project and the transition is causing some pain.

您的选择是:

使用 -v 选项运行 bootstrap.py,强制它使用特定的早期版本:

Run bootstrap.py with the -v option, forcing it to stick to a specific, earlier version:

 $ bin/python bootstrap.py -d -v 2.1.1

2.1.1 版的 buildout 不会将自身升级到 2.2 或更新版本,而是与您的 distribute 提供的 setuptools 蛋一起使用.

Version 2.1.1 of buildout will not upgrade itself to 2.2 or newer and works with your distribute-supplied setuptools egg.

从您的 site-packages 中手动删除所有 distribute*pkg_resources.py*setuptools* 文件目录:

Manually delete all distribute*, pkg_resources.py* and setuptools* files from your site-packages directory:

$ 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*

和(可选)使用最新的 ez_setup.py 重新安装 setuptools;当前版本为 0.9.6,setuptools PyPI 页面 将您链接到 这个 ez_setup.py 版本.

and (optionally) reinstall setuptools from with the latest ez_setup.py; the current version is 0.9.6, and the setuptools PyPI page links you to this ez_setup.py version.

您还需要升级您的 bootstrap.py 脚本,见下文.

You'll also need to upgrade your bootstrap.py script, see below.

1.9 版或更新的 virtualenv(2013 年 3 月发布)允许您使用 --no-setuptoolssetuptools 蛋的 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:

$ virtualenv --no-setuptools buildout_env

使用它来创建一个虚拟环境 python 来运行你的 bootstrap.py.你仍然需要升级你的 bootstrap.py.见下文.

Use that to create a virtual env python to run your bootstrap.py. You still need to upgrade your bootstrap.py too. See below.

对于 zc.buildout 2.2.0 及更高版本,bootstrap.py 脚本已更新以加载 setuptools 未分叉-版本.在 从 github 获取新副本(链接到 2 分支版本),用它替换旧的 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.

请确保您确实删除了旧的分叉 -distribute-but-pretending-to-be-setuptools egg 首先或使用不支持的虚拟 env python 运行有那个鸡蛋.见上文.

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.

这篇关于bin/python bootstrap.py -d 期间如何解决pkg_resources.VersionConflict错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆