Super nub question time! I am trying to use simplejson on the google appengine. In a terminal on my machine I have simplejson installed and working. But my when I try to import it in a script running on the appengine I get an error saying no such library exists. If open the interactive console on my machine (from the link on http://localhost:8080/_ah/admin) and type "import simplejson" I get:
Traceback (most recent call last): File "/home/chris/google_appengine/google/appengine/ext/admin/init.py", line 210, in post exec(compiled_code, globals()) File "", line 1, in ImportError: No module named simplejson
Any thoughts?
Look in django package:
from django.utils import simplejson as json
obj = json.loads(json_string)
Since Sdk 1.4.2 Json can be imported with the following statement:
import simplejson
Note that on Python 2.7 runtime you can use the native Json library.
You no longer need to use the django package for simplejson on Google App Engine.
import simplejson as json
This is expecially handy for avoiding the flurry of warnings about django versions in your log file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With