← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #247294]: Sikuli: In Eclipse with PyDev and Jython i am getting ImportError: No module named sikuli

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
*** The problem i am facing is that the Functions "exists", "click" etc. have a Red cross
This cannot be solved/fixed, since the undotted usage of the Region and Screen methods only get bound to the primary Screen object at runtime, hence the syntax check in Eclipse has no chance to know these "variables".
You either have to live with that, or use the dotted version:
s = Screen()
s.exists(...)

*** image files not found
In Sikuli IDE when running a script, the bundle path is automatically set to the script folder.
This is not the case when running with external Jython like in your Eclipse case (you are not running a Sikuli script, but a .py script).
You might use addImagePath() or setBundlePath() to tell Sikuli where to find the images.

To get the working folder at runtime, you might try the Python os module features or the Java stuff like this:
import java.lang.System as JS
JS.getProperty("user.dir") # working folder

or 
JS.getEnv("env-var") # the content of  environment variable

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