tags:

views:

285

answers:

2

Hey all,

I'm very new to Python development, and am having a problem with one of my apps in OSX.

Technologies being used in this project

  • python 2.6
  • django
  • google app engine
  • rpx (openid)

When loading up the site on my windows app, there are no issues, but when trying to same app on OSX 10.6, I get the following issue:


ImportError at /rpx/rpx/login/

No module named _ctypes

Here's where the error is happening:

/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ctypes/init.py in

#

"""create and manipulate C data types in Python""" import os as _os, sys as _sys version = "1.1.0" from _ctypes import Union, Structure, Array


Any ideas? Thanks!

A: 

The only thing that I can think of is that maybe it's not on your path. Seems unlikely, but I would check that anyways.

inspectorG4dget
+5  A: 

OS X 10.6's Python 2.6 does include ctypes by default. You can even see part of it in the error report. So if there's a problem with the installation, it's only a problem with part of ctypes. That suggests that either it was damaged somehow or that something else is interfering with some part of the ctypes internals.

Google App Engine is a prime candidate for this interference. ctypes itself is not available on Google App Engine.

It looks like this might be a specific interaction between Python 2.6, OS X, and Google App Engine. Likely the same problem would not be encountered if you actually upload your application to GAE for real deployment.

This issue has been raised in the GAE issue tracker here: http://code.google.com/p/googleappengine/issues/detail?id=985

The last comment there suggests changing your GAE preferences to use Python 2.5 (/usr/bin/python2.5) as a possible resolution to the issue on your OS X development machine.

Jean-Paul Calderone
Thank you! I installed (via macports) Python 2.5, and then edited the first line of /usr/local/google_appengine/dev_appserver.py to #!/usr/bin/python2.5
Carl