← Back to team overview

sikuli-driver team mailing list archive

[Question #294624]: Running python code outside of SikuliX IDE

 

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

Hi All,

Sorry to ask this, but I am somewhat of a noob when it comes to coding and setting up my IDE’s, because I’ve just recently began learning Python/coding …

I am writing my python in ATOM (not in the SikuliX IDE), so my first line is:

from sikuli import *

I get an error ImportError: No module named 'sikuli'

I completely understand that the syntax is Python, but the interpreter is Jython, but because of this I have no idea how to actually run my code that I write outside of the SikuliX IDE.

I have installed Jython and I can successfully run the interactive Jython session, and I have installed Jip (per instructions on http://sikulix-2014.readthedocs.io/en/latest/scenarios.html#using-python).

I have tried creating the script you advised on https://answers.launchpad.net/sikuli/+question/136013 but I get this error when I try to run it from terminal passing my .sikuli file when running:

None: No module named __main__

I think one thing I need to do is add Sikuli to my python sys.path but

1) Im not 100% sure this is correct because it is really Jython code, not python
2) What would I even add to sys.path, is it “/Applications/SikuliX/SikuliX.app/Contents/Java/sikulix.jar” 

Ive also tried writing my code and then tried to run from the command line without the IDE as per "http://doc.sikuli.org/faq/010-command-line.html"; but it strangely loads the Sikuli IDE and then opens a blank untitled sikuli file.

Would anyone be able to help me run my python code outside of the SikuliX IDE please?

Thanks very much for any help,
Jamie

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