Getting started with App Engine development on Ubuntu 10.10 with Python 2.5

Post to Twitter

Newer versions of Ubuntu don’t come with Python 2.5 anymore however Google App Engine still requires (as of the date of this article) that you continue to use Python 2.5 for App Engine development. Some people have been using Python 2.6 but you need to be very careful. In the end for now it is safer to just use Python 2.5. Today I’ll go over what you need to do in order to get Python 2.5, the App Engine SDK, and Ubuntu 10.10 all working together and end it with a Hello World app.

Note: I’ve adapted the instructions from here and here.

Since the Python 2.5 bits are no longer in the Ubuntu repositories you need to grab them from here. You can do this easily from a terminal window:

$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python2.5

Optional: Install the imaging tools:

$ sudo apt-get install python2.5-dev
$ sudo apt-get install libjpeg62-dev
$ sudo easy_install-2.5 pil

Run Python 2.5 to verify it’s working:

Type quit() to exit. Next, install the Python Setup Tools and grab the App Engine SDK (adjust the paths for newer versions of the Python App Engine SDK):

$ cd /tmp
$ wget
$ sudo sh setuptools-0.6c11-py2.5.egg
$ cd
$ wget wget
$ unzip

Let’s modify the .bashrc file now to make life easier when working with the SDK, for me this was:

$ cd
$ sudo pico .bashrc

Append this to the file:

export PATH=${PATH}:/home/{username}/google_appengine

Mine looked like this:

export PATH=${PATH}:/home/chadlung/google_appengine

Now we will modify the file located in the App Engine SDK folder. This ensures we will always use Python 2.5.

$ cd google_appengine
$ sudo pico
(you can use a different text editor if you wish)

Change the first line from:

#!/usr/bin/env python


#!/usr/bin/env python2.5

Save and exit Pico after the change you just made.

Note: You might want to modify the other tool scripts to ensure they use Python 2.5 as well.

Let’s now create a Hello World app and see if everything works:

$ cd
$ mkdir helloworld && cd helloworld
$ pico

Add the following code to the file using Pico (or some other editor):

print 'Content-Type: text/plain'
print ''
print 'Hello World!'

Create the app.yaml file now:

$ pico app.yaml

The code for app.yaml:

application: helloworld
version: 1
runtime: python
api_version: 1

- url: /.*

Make sure we are in our home folder and run the app:

$ cd
$ helloworld/
(the built-in app engine web server will now start, allow it to auto update if it asks you)

Browse to: http://localhost:8080

Thats all there is to it.

Post to Twitter

This entry was posted in App Engine, Python, Ubuntu. Bookmark the permalink.

2 Responses to Getting started with App Engine development on Ubuntu 10.10 with Python 2.5

  1. Pingback: Getting started with App Engine development on Ubuntu 10.10 with Python 2.5

  2. Javier says:

    Thank you very much for this writeup. I am new to both linux and Google App Engine and your tutorial helped me get started!

Comments are closed.