← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #698171]: Issue setting up Sikuli Eclipse

 

Question #698171 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698171

    Status: Open => Answered

RaiMan proposed the following answer:
Sorry for the inconvenience, but I switched from NetBeans/Eclipse many
years ago to the IntelliJ IDEs (IDEA and PyCharm).

So I can give you some hints only, what should be done to get an
environment running withEclipse PyDev.

Terminate Eclipse for the next steps.

This is checked on Windows (but should be similar on macOS and Linux)

Have the latest Java 8 running.

--- get SikuliX IDE working
1. Download the 2.0.5 IDE jar and put it somewhere. You might rename it to whatever you want
2. Delete the folder C:\Users\...\AppData\Roaming\Sikulix if it exists
3. Run the IDE using
java -jar <path-to-sikulix-ide-jar> -v -c
The IDE should start up.
Run a one-liner like popup("hello").
If it works, stop the IDE (without saving anything)
If it does not work, read the debug log and identify the possible cause.

Now you should have a folder C:\Users\...\AppData\Roaming\Sikulix\Lib,
which contains all the py-files needed including the stuff from Jython
2.7.2.

--- get Jython working
install Jython 2.7.2 and get it running

--- get Eclipse Pydev running
Make sure, that a newly created simple project is working with the installed Jython 2.7.2. Do not touch any SikuliX stuff for now.

Now make a new project to test the usage of SikuliX:

the main script should be something like this:
import sys
for e in sys.path: print e
from sikuli import * # this is the mandatory line!
popup("hello")
hover()
exit()

In the setup for this project or in the global setup you have to add
C:\Users\...\AppData\Roaming\Sikulix\Lib   and
<path-to-sikulix-ide-jar>

so that they are on sys.path at runtime.

Now you might try to run the above main script.

In my PyCharms setup it shows:
C:\Users\rmhde\PycharmProjects\SikulixTest
C:\Users\rmhde\AppData\Roaming\Sikulix\Lib
C:\Users\rmhde\PycharmProjects\SikulixTest
C:\SXRun\_Latest\2_0_5\sikulixide-2.0.5-win.jar
C:\jython2.7.2\Lib
__classpath__
__pyclasspath__/
C:\jython2.7.2\Lib\site-packages

The double entries look ugly, but do not do any harm ;-)

In version 2.0.6 I will bring back better support for running with
external Jython or non-SikuliX IDE's.

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