2013-06-12 60 views
1

我们在AWS EC2上安装了多个Ubuntu实例,并安装了不同版本的boto。一个是2.2.2,另一个是2.8.0。我们的一个脚本在两台机器上的行为有所不同,而不是在旧的boto上运行。我试图看看版本差异是否是它的原因,或者是否有其他事情发生。所以我想要做的就是回到2.2.2来测试2.8.0的实例。我如何安装旧版本?我试过sudo pip install -U boto 2.2.2,但它给了我Could not find any downloads that satisfy the requirement 2.2.2如何在AWS实例上安装旧版本的boto?

回答

1

我会使用virtualenv。用2.8.0在实例上创建一个新的虚拟环境,并确保告诉virtualenv不要使用系统安装的软件包。我敢肯定,这是默认行为,但是,以防万一:

$ virtualenv --no-site-packages test_old_boto 

一旦virtualenv中创建:

$ cd test_old_boto 
$ source bin/activate 

,然后在安装virtualenv中的旧版本的Boto:

$ pip install boto=2.2.2 

你应该能够测试一下。

+0

但不是'PIP安装博托= 2.2.2'基本上是一样的我'须藤PIP安装-U博托2.2 .2'?我得到的消息似乎表明'pip install'找不到要下载的正确包。如何运行'virtualenv'帮助? –

+0

对不起,我错过了那部分问题。我不确定为什么pip无法找到2.2.2,但是你可以从https://github.com/boto/boto/tree/2.2.2下载tarball,解开它然后做一个“python设置”。 py安装“。我仍然建议使用virtualenv来保持此安装与2.8.0安装分离。 – garnaat

0

Lisa Watanabe正确回答以任何理由删除,正确的语法是sudo pip install --upgrade boto==2.2.2pip install --user --upgrade boto==2.2.2