Friday, January 3, 2014

Setting up a local Google App Engine Development Environment for Python

Installing Google App Engine Dev. Environment

I have a mac running latest OSX 10.9 Mavericks. I want to be able to develop and test a Python Google App Engine app on this machine. This is the list of steps I took to make it happen. I am starting from a fairly clean machine as my older mac have multiple installations of Python, and I seem to get stuck attempting to setup my dev environment on it.

I placed this list here, as some of the documentation around the web is scattered and sometimes confusing or outdated. This was done on OSX Mavericks.Some of the steps below are specific to my own app (pycrypto, PIL and lxml may or may not be needed by your app).

Ok, now that I have the app engine development environment setup on a new mac, and some test scripts running fine, I am going to clean up my old mac (which is actually my work machine - a Mid 2012 Mac Book Air 13” with OSX 10.9.1).

It seems a bit radical, but after looking into what I got from running the list of files, it seemed to be fine. So I just did that and deleted all the directories and files listed under /Library/Frameworks/Python.framework various old versions, the Applications folder and the Receipts folder.

Finally, I made a symbolic link to the Apple python from /Library/Frameworks by:

cd /Library/Frameworks

then (just to be on the safe side):

sudo mv Python.framework Python.framework.orig

and then

ln -s /System/Library/Frameworks/Python.framework/ Python.framework

Next, I changed the python in the GAE Launcher preferences to /usr/bin/python2.7 and Voila!