SimpleJson Error with django under google app engine

Since moving over to 64 bit windows 7, I’ve had this error when starting up:

"... py_zipimport.py:108] zipimporter('C:\\python25\\lib\\site-
packages\\simplejson-2.0.9-py2.5-win.egg', 'simplejson\\') ...
dev_appserver_main.py ... SetGlobals() ...
...
File "C:\Program 
Files\Google\google_appengine\google\appengine\dist\py_zipimport.py", line 
268, in _getitem__
info = _zipfile_cache[self._archive].getinfo(filename)
File "C:\Python25\lib\zipfile.py", line 462, in getinfo
return self.NameToInfo[name]
KeyError: 'simplejson\\_speedups.pyd'

The solution is from peplafi on the google app engine defect list:

It looks that it gives the error when you have installed simplejson in your python
dist and dev_appserver is mixing its own simplejson (which is located in
django\utils) and the python’s sipmlejson. The solution is to go to

The solution is to go to 

"c:\Program Files\Google\google_appengine\google\appengine\ext\key_range\__init__.py" 
, line 26

and change:

   import simplejson

 to:

   from django.utils import simplejson

This entry was posted in Python. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>