Sikuli python scripting in visual studio

Asked by mohammad on 2018-12-28


I am new to both sikuli and visual studio. I downloaded the sikuli jar and played around with writing sikuli scripts in the sikuli IDE. I was wondering if there is a way to sikuli development in visual studio just because I prefer the environment. I see packages I can install like jython-sikuli-server, jython-sikuli-client, robotframework-SikuliLibrary etc... but still dont see anything that gives me the same programming API that the IDE does.


Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

--- jython-sikuli-server, jython-sikuli-client, robotframework-SikuliLibrary
all those "libraries" have their own ecosystem and you have to check each package wether it is useful for you.
some packages out there rely on or contain SikuliX versions, that are no longer supported.

Here only the original SikuliX versions are supported (preferably the latest 1.1.4)

--- Visual Studio
I am not familiar with the features of it.
SikuliX is based on Java and hence you can write programs/scripts in other IDE's either with Java or with Java aware scripting languages (like Jython, JRuby, JavaScript, ...).
So you have to check what is possible for you in VS.

mohammad (jazarmoh) said : #2

when adding the libraries from sikulixapi.jar from visual basic like:

after running import sikuli I get the following error:

Traceback (most recent call last):
  File "c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\extensions\microsoft\python\core\", line 130, in <module>
  File "c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\extensions\microsoft\python\core\", line 114, in _run_repl
  File "c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\extensions\microsoft\python\core\ptvsd\repl\", line 748, in execution_loop
    exit, cur_modules, cur_ps1, cur_ps2 = self.run_one_command(cur_modules, cur_ps1, cur_ps2)
  File "c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\extensions\microsoft\python\core\ptvsd\repl\", line 672, in run_one_command
    self.execute_item = None
  File "c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\extensions\microsoft\python\core\ptvsd\repl\", line 670, in run_one_command
  File "c:\program files (x86)\microsoft visual studio\2017\professional\common7\ide\extensions\microsoft\python\core\ptvsd\repl\", line 645, in execute_code_work_item
    exec(code, self.exec_mod.__dict__, self.exec_mod.__dict__)
  File "<stdin>", line 1, in <module>
  File "C:\jython2.7.0\Lib\site-packages\sikulix\Lib\sikuli\", line 6, in <module>
    from Sikuli import *
  File "C:\jython2.7.0\Lib\site-packages\sikulix\Lib\sikuli\", line 31, in <module>
    RUNTIME = RunTime.get()
 at org.sikuli.script.RunTime.init(
 at org.sikuli.script.RunTime.get(
 at org.sikuli.script.RunTime.get(
 at org.sikuli.script.RunTime.get(
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
 at java.lang.reflect.Method.invoke(

java.lang.NullPointerException: java.lang.NullPointerException
An internal error has occurred in the Interactive window. Please restart Visual Studio.

any idea what the issue might be ? my JAVA_HOME is set to "C:\Program Files\Java\jdk1.8.0_191"

RaiMan (raimund-hocke) said : #3

Make sure, to use the latest build of sikulixapi.jar (>#178)

Can you help with this problem?

Provide an answer of your own, or ask mohammad for more information if necessary.

To post a message you must log in.