Local Appengine stopped working
Question: I tried to run one of my AppEnigne projects (python) today but it will no
longer launch, this is the stack trace I'm getting.

    
    
     *** Running dev_appserver with the following flags:
        --admin_console_server= --port=8080 --clear_datastore
    Python command: /usr/bin/python2.5
    Traceback (most recent call last):
      File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py", line 77, in <module>
        run_file(__file__, globals())
      File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/dev_appserver.py", line 73, in run_file
        execfile(script_path, globals_)
      File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver_main.py", line 138, in <module>
        import logging
    ImportError: No module named logging
    

I thought it could be a python 2.6 error but I adjusted my path to
`/usr/bin/python2.5` and its still not working. I'm running OSX 10.6.8 and
have the latest AppEngineLauncher 1.5.4

The only thing I changed recently that might have affected this is when I
updated my XCode to the latest version, v4.2 build 4C199

Has anyone else faced this issue recently?

EDIT I can't `import logging` from the terminal either, same message. Here's
Python's path.

    
    
        Chriss-MacBook-Pro:bin chris$ /usr/bin/python2.5
        Python 2.5.4 (r254:67916, Aug  2 2010, 20:09:39) 
        [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
        Type "help", "copyright", "credits" or "license" for more information.
        >>> import sys
        >>> sys.path
        ['', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', 
    '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload',
     '/Library/Python/2.5/site-packages',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC',
     '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode']
        >>> 
    


Answer: Thanks to Nick and Wobble I've figured it out. I recently updated my XCode
install to the 4.2 GM release and removed the beta versions. Along the way OSX
forgot where gcc was installed and prevented it from compiling the python
modules like `logging`. This resulted in missing `.pyo` files inside
`/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25/logging`
which prevents `import logging` from working.

Logging wasn't the only module that wasn't compiled, just the first one
AppEngine tried to import.

Solution: uninstall and do a clean install of XCode. Make sure gcc can be
found on your PATH and everything should be fine.

