← Back to team overview

sikuli-driver team mailing list archive

[Question #193318]: json import error

 

New question #193318 on Sikuli:
https://answers.launchpad.net/sikuli/+question/193318

I want to import a module (written in python2.4) which is using json and simplejson into my own sikuli program.  
I included therefore json_simple-1.1.jar and jyson-1.0.2.jar (from opensource.xhaus.com/projects/show/jyson) in the class path of sikuli.ini. Both jar files are in the sikuli installation folder. I also included "from sikuli import *" in the module I want to import at the very beginning. The module is in the same folder as my own written module.

When running Sikuli-IDE, I get the error message in that import file:

"File "modulexxx.py (=name of the import module)", line 94, in 
from json import loads as json_decode, dumps as json_encode
ImportError: No module named json"

The code excerpt from the module I want to import:
-----
try:
    from json import read as json_decode, write as json_encode
except ImportError:
    try:
        from json import loads as json_decode, dumps as json_encode
    except ImportError:
        from simplejson import loads as json_decode, dumps as json_encode   <- this is line 94
----

Does anyone now how I get the import of the module work?
I am a sikuli and python beginner, so any help would be highly appreciated!


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.