Error importing simplejson and antlr3 to djangoappengine project

146 Views Asked by At

I'm building a project that uses django-app-engine, but get some import errors when running the project with the GAE launcher.

My first error is importing simplejson, same as: Error importing simplejson after upgrading to appengine dev server 1.7.6

I've resolved that issue by modifying old_dev_appserver.py in the GAE bundle to import 'json' instead of 'simplejson' (I hope it's ok that I modified the GAE bundle..)

After the change, I receive a new error:

 File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/cron/groc.py", line 31, in <module>
    import antlr3
ImportError: No module named antlr3

In the link above, @trope actually commented on having the same issue, but I thought a new question would be better than adding comments to the original issue (which is resolved by changing simplejson to json)

As suggested here: Django App Engine can't find antlr3 module, I've tried to add

os.path.join(SDK_PATH, 'lib', 'antlr3')

And also tried to install the antlr3 runtime.

I feel this issue is different to the one above because it's a direct result of the simplejson workaround, but perhaps it is the same.

Python 2.7.2, GAELauncher 1.9.4

Any suggestions?

edit: I've also now tried the exact same setup/codebase on my PC with the latest version of Launcher, and I get the exact same two errors: first simplejson, then antlr3. Maybe that means it's an issue with the codebase/djangoappengine install?

1

There are 1 best solutions below

1
On

OK, this should be solved. Make sure you have updated all the django nonrel projects (dbindexer, django, djangoappengine, djangotoolbox, and whatever else you use). Also, run gcloud components update from the command line.

In addition to adding os.path.join(SDK_PATH, 'lib', 'antlr3'), did you also actually download and install it? From the command line, run whereis antlr3.