在Google App Engine(GAE)上运行Boto

时间:2021-12-15 23:16:12

I'm new to Python and was hoping for help on how to 'import boto.ec2' on a GAE Python application to control Amazon EC2 instances. I'm using PyDev/Eclipse and have installed boto on my Mac, but using simply 'import boto' does not work (I get: : No module named boto.ec2). I've read that boto is supported on GAE but I haven't been able to find instructions anywhere. Thanks!

我是Python的新手,希望能帮助我们在GAE Python应用程序上“导入boto.ec2”来控制Amazon EC2实例。我正在使用PyDev / Eclipse并在我的Mac上安装了boto,但只使用'import boto'不起作用(我得到::没有名为boto.ec2的模块)。我已经读过GAE支持boto,但我无法在任何地方找到说明。谢谢!

2 个解决方案

#1


6  

It sounds like you haven't copied the boto code to the root of your app engine directory.

听起来你没有将boto代码复制到app引擎目录的根目录。

Boto works with GAE but Google doesn't supply you with the code. Once you copy it into the root of your GAE directory, the dev server should work, and after your next upload it will work on the prod server as well.

Boto与GAE合作,但Google不为您提供代码。将它复制到GAE目录的根目录后,开发服务器应该可以工作,下次上传后它也可以在prod服务器上运行。

#2


3  

Symbolic link should be enough. in your project root:

符号链接应该足够了。在您的项目根目录中:

ln -s /path/to/boto/boto boto

Google app engine will upload it while deploying your app.

Google应用引擎会在部署您的应用时上传它。

#1


6  

It sounds like you haven't copied the boto code to the root of your app engine directory.

听起来你没有将boto代码复制到app引擎目录的根目录。

Boto works with GAE but Google doesn't supply you with the code. Once you copy it into the root of your GAE directory, the dev server should work, and after your next upload it will work on the prod server as well.

Boto与GAE合作,但Google不为您提供代码。将它复制到GAE目录的根目录后,开发服务器应该可以工作,下次上传后它也可以在prod服务器上运行。

#2


3  

Symbolic link should be enough. in your project root:

符号链接应该足够了。在您的项目根目录中:

ln -s /path/to/boto/boto boto

Google app engine will upload it while deploying your app.

Google应用引擎会在部署您的应用时上传它。