在Unbuntu9.04中运行AppEngine

    今天,在测试AppEngine中的一些代码时,发现了一个很奇怪的问题(用的环境是Python):发现用logging中的logging.debug("message")是可以的,但是用其它的logging.error("message")等就有问题了(这个问题让我找的好苦阿!); 查看错误信息,不是我代码的问题;后来在google上找到了问题原因,说是AppEngine的官方现在只支持Python2.5,也就是说对Python2.6支持不好;于是我就想到把Python2.6卸载掉,然后再装Python2.5;可是不能够删除,说是unbuntu对此有依赖,于是就先装了2.5,然后再删除2.6,还是不能够删除;有点绝望了!于是就在拼命地google,最后终于找到了这篇文章:http://www.buildcontext.com/blog/2009/05/03/problem-problems-google-app-engine-on-ubuntu-9-04-jaunty-jackelope-python/

 

原文如下:

 

Problem Solving: Get Google App Engine working on Ubuntu 9.04 (Jaunty)


By default the Google App Engine SDK doesn’t run on Ubuntu 9.04 (Jaunty Jackelope)… You can fix it!

After a little searching I noticed neither posts about this issue nor a quick fix were top of the Google rankings… hoping to resolve that with this post and get all of us Ubuntu 9.04 (Jaunty) users up on App Engine. UPDATE: This post is now first when searching for “App Engine Ubuntu Jaunty Problem ” and even “App Engine Ubuntu Jaunty ” in one day, nice!

Once you download the SDK as usual and run one of your apps on a default Ubuntu 9.04 Jaunty install you will see errors galore, you see Ubuntu 9.04 ships Python 2.6 and App Engine is built on Python 2.5 and they are not friendly!

Here is how I got my environment running, I will update the post if I run into further errors.

In a terminal install Python 2.5

They will coexist on the system.

sudo apt-get install python2.5

Edit dev_appserver.py in your google_appengine directory

Change the first line in dev_appserver.py…

#!/usr/bin/env python

….to…

#!/usr/bin/env python2.5

App Engine should now load and run your apps properly!

I believe this is the simplest noninvasive way to let App Engine find what it wants, Python 2.5, and let Ubuntu carry on as it likes with Python 2.6 and beyond. Here is a source on this issue, commenters have many different solutions.

Hope this post helps at least one of you,
-Ben

 

================================================

还有一种更加简单的方法(不用修改任何文件,而是用Unbuntu下的ln方法):

1.  首先安装 Python2.5;

     

2.  然后用ln命令设置一个链接;

3. 在eclipse中作相应的设置;

    点击 Window->Perferences, 在对话框中左边选择 Pydev->Interpreter -Python,选择New..(如图);按照图中的步䠫就可以

了;

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值