Netbeans running and debugging sikuli scripts problem

Asked by Paul Good

Im running:
Netbeans 8.1
Java 8
Sikulix 1.1.2
Jython 2.7.0

Im having trouble running sikuli scripts in Netbeans. I had it running fine but tweaked some options because in debug mode couldnt get Sikuli import statements to work. Not sure what I did but now cant get Siklui scripts to run at all in a Netbeans environment without getting error from statement "from sikuli.Sikuli import *"
that error being: ImportError: cannot import name Debug

Other discussions talk about sikuli-script.jar and sikuli-script.jar/Lib being on sys.path and java path but sikuli-script.jar is not part of Sikulix 1.1.2.

Ive tried various combinations of using sikulix.jar and sikulix.jar/Lib and sikulixapi.jar and sikulixapi.jar/Lib on forementioned paths but to no avail.

I also have JRE on Windows PATH. Also Sikuli jar files are not on a path with spaces in it.

Also have same problems with Sikulix 1.1.1

Thanks Paul

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Paul Good
Solved:
Last query:
Last reply:
Revision history for this message
Paul Good (paulgood1) said :
#1

OK got it running again when sikuli scripts are put in a Jython based Netbeans project.
However, I cant debug same files. Get error:
ImportError: No module named sikuli.

using "from sikuli.Sikuli import *"

Not sure what is so special about Debug mode?

Thanks
Paul

Revision history for this message
Paul Good (paulgood1) said :
#2

Got it further by using
import org.sikuli.script.SikulixForJython
from sikuli import *
but now I cant read from own Sikuli libraries. I have added them on python path. It all works with run mode but not debug mode.
Dont have this problem with pycharm in either run or debug modes. Although that wasnt without its problems. In pycharm didnt add own sikuli libraries to pythonpath so not sure how it picked those up.
I prefer Netbeans so was hoping to get that working in debug mode.

Revision history for this message
RaiMan (raimund-hocke) said :
#3

I do not have any recent experiences with Jython based projects in Netbeans 8.1.

Generally the things mentioned here:
https://github.com/RaiMan/SikuliX-2014/wiki/Jython-in-IDEs-like-Eclipse-or-running-it-from-commandline

might help to make the correct setup (only works with Java 8).

Revision history for this message
Paul Good (paulgood1) said :
#4

Netbeans 8.1 and 8.2 behave the same.
For debug mode only I had to copy over customized python libraries to Jython Lib directory for it to work. No other paths set to customized python libraries on Python Path didnt work.
Why Debug mode and Run mode behave differently is beyond me.

Revision history for this message
Paul Good (paulgood1) said :
#5

Alternative way is to add customized libraries to sys.path on the fly,
ie.
sys.path.append(myScriptPath)

it seems that Netbeans debugger or any other Jython IDE doesnt pick up environment properly.