← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #193318]: json import error

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
nice try ;-)

Since you are working on the Python level (Sikuli IDE uses the Java
based Jython interpreter), you have to use Python modules in the first
place, if you are using modules, that expect Python code or API's.

What you downloaded are Java classes, that might principally be used in
Sikuli scripts too, but only, if the API names and the signatures are
fully compatible. But usually, the imports are different, since java
packages are dot-structured usually - in this case: org.json.simple. So
this only might have a chance to work, if you are coding the imports
yourself (not the fact in this case).

So in your case, the easiest trial might be, to use the simple-json implementation from:
http://pypi.python.org/pypi/simplejson/
Download and uncompress somewhere, but do not install it!
Copy the contained  folder simplejson to the folder Lib in the Sikuli X program folder (you might have to create it). This folder is in the sys.path already, so anything stored here, can be imported without any sys.path manipulations.

Come back for more help.

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