← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #247294]: [1.0.1] Eclipse with PyDev and Jython: getting ImportError: No module named sikuli

 

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

    Status: Answered => Open

Cisum4 is still having a problem:
Hi Raiman,
Thanks ! I made good progress and my scripts are now running in Python+Jython+Eclipse.
I have one last question- even after i did
s = Screen()
s.exists(...)

I still get the Red Cross mark on "s" - although the script runs successfully. Any workaround for that. I have attached a image for illustration. Thanks for your help! 
On Monday, April 21, 2014 12:36 AM, RaiMan <question247294@xxxxxxxxxxxxxxxxxxxxx> wrote:
 
Your 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

-- 
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/247294/+confirm?answer_id=2

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/247294

You received this question notification because you asked the question.

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