← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #676645]: ImportError: no module named sikuli

 

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

    Status: Answered => Open

Dave Kane is still having a problem:
RaiMan,
Thanks, you have been very patient with me and I appreciate it. I am trying to run the python code, in this case dak2.py, that gets created when you save from the IDE. I have set the classpath properly (a linux which sikuli.jar/sikulixapi.jar finds the files in the /home/admin/Sikuli directory, which also has the directory dak2.sikuli directory containing the image files and the python script) yet still get the same outcome. Could it be an issue with the directory structure I'm using, capitalization of the filenames? I aware of some dependencies associated with where the various sikuli files are located.  

David

      From: RaiMan <question676645@xxxxxxxxxxxxxxxxxxxxx>
 To: dakane204@xxxxxxxxx 
 Sent: Friday, December 7, 2018 3:57 AM
 Subject: Re: [Question #676645]: ImportError: no module named sikuli
  
Your question #676645 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/676645

    Status: Open => Answered

RaiMan proposed the following answer:
the intro statements for standalone .py scripts is
import org.sikuli.script.SikulixForJython
from sikuli import *

... and sikulixapi.jar has to be on the classpath.

sorry, but the docs for that are a bit hidden ;-)
https://github.com/RaiMan/SikuliX-2014/wiki/Jython-in-IDEs-like-Eclipse-or-running-it-from-commandline

For running scripts from commandline simply use this command:
java -jar <path-to>/sikulix.jar -r <path-to>/myscript.sikuli

for the available parameters see:
https://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html

-- 
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/676645/+confirm?answer_id=0

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/676645

You received this question notification because you asked the question.

You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.