Sikuli script when moved to 64bit environment throws an error

Asked by Rubynator

Hi!

I know similar bugs have been filed on this, but according to Raiman It wasn't a bug.
So, I've a script ready and work fine on my local 32bit WIN 7system. Now I exported it with CTRL-SHIFT-E to a skl. file and shared it with my co workers. They have 64Bit Win7, and installed fresh version of java and sikuli.
When they try to run .skl script on their environment they keep getting this weird file missing error.
So sharing .skl isn't enough? Am I supposed to share the whole sikuli source?
This is a roadblock now, please help! Below is the output!

C:\Users\Rubynator\Desktop>assignment64.skl

C:\UsersRubynator\Desktop>C:\Sikuli\Runide -r *.skl -d3 -c
'Files' is not recognized as an internal or external command,
operable program or batch file.
+++ running this Java
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
+++ trying to start Sikuli IDE
+++ using: -Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine -jar
C:\Sikuli\sikuli-ide.jar -r *.skl -d3 -c
[debug] SikuliIDE: Switching to SikuliScript with option -r, -t or -i
[debug] SikuliScript: CmdOrg: -r *.skl -d3 -c
[debug] Running on Java 7 (1.7.0_51-b13)
[debug] --- Sikuli parameters ---
[debug] 1: -r
[debug] 2: assignment64.skl
[debug] 3: -d3
[debug] 4: -c
[debug] FileManager: tempdir create: C:\Users\Rubynator\AppData\Local\Temp\Rubynator\tmp-906484839.sikuli
[debug] SikuliScript: givenScriptName: C:\Users\Rubynator\AppData\Local\Temp\Rubynator\tmp-906484839.sikuli\assignment64.sikuli
[error] FileManager: Script folder C:\Users\Rubynator\AppData\Local\Temp\Rubynator\tmp-906484839.sikuli\assignment64.sikuli does not contain a script file named assignment64.xxx
[error] Terminating SikuliX after a fatal error! Sorry, but it makes no sense to
 continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.
[debug] SikuliXFinal: cleanUp: 0

C:\

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

the log seems to tell, you are using
-r *.skl
on command line.

I have no idea what happens in this case - at least it is not defined.

use this:
C:\Sikuli\runIDE.cmd -r some-scriptname.skl -d3 -c

Revision history for this message
Rubynator (datagatepdx) said :
#2

Raiman,

True, I associated all the .skL file with a batch file , to run them instantly from window by just double clicking on them.
So -r on command line since it's being called from a batch file is actually working fine.

I just tried from the command line , manually..as you said
C:\Sikuli\runIDE.cmd -r some-scriptname.skl -d3 -c and gives the same error,
everything is a fresh install ;(

Here's the debugged log;

C:\Sikuli>runide -r C:\Users\Rubynator\Desktop\assignment64.skl -d3 -c
'Files' is not recognized as an internal or external command,
operable program or batch file.
+++ running this Java
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
+++ trying to start Sikuli IDE
+++ using: -Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine -jar
C:\Sikuli\sikuli-ide.jar -r C:\Users\Rubynator\Desktop\assignment64.skl -d3 -c
[debug] SikuliIDE: Switching to SikuliScript with option -r, -t or -i
[debug] SikuliScript: CmdOrg: -r C:\Users\Rubynator\Desktop\assignment64.skl -d3 -
c
[debug] Running on Java 7 (1.7.0_51-b13)
[debug] --- Sikuli parameters ---
[debug] 1: -r
[debug] 2: C:\Users\Rubynator\Desktop\assignment64.skl
[debug] 3: -d3
[debug] 4: -c
[debug] FileManager: tempdir create: C:\Users\Rubynator\AppData\Local\Temp\Rubynator\tmp-681303371.sikuli
[debug] SikuliScript: givenScriptName: C:\Users\Rubynator\AppData\Local\Temp\Rubynator\tmp-681303371.sikuli\assignment64.sikuli
[error] FileManager: Script folder C:\Users\Rubynator\AppData\Local\Temp\Rubynator\t
mp-681303371.sikuli\assignment64.sikuli does not contain a script file named assignment64.xxx
[error] Terminating SikuliX after a fatal error! Sorry, but it makes no sense to
 continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.
[debug] SikuliXFinal: cleanUp: 0

C:\Sikuli>

I'm frustrated now..

Revision history for this message
obiwan-92 (obiwan-92) said :
#3

@ Rubynator
-- So sharing .skl isn't enough? Am I supposed to share the whole sikuli source?
I'm sorry, but normally, you have only a.py file and some png.
Why did you not share it ?

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

@Rubinator
I fully understand your frustration.
But do not overestimate .skl
it is simply a zipped version of the respective .sikuli folder. Anyon who knows that just unzips it and here you are.
Nevertheless it should work.

I am only back home tomorrow to get a chance to test on my Windows.

Revision history for this message
Rubynator (datagatepdx) said :
#5

@ obiwan-92

- I did. I was hoping extracting the script to .skl file (a single file) and sharing that would be enough, since as Raiman said, it's just a zipped version of the .py and the the png files.
I appreciate your comments highly, but these still don't answer the question.

@RaiMan Yes, I'm looking forward to see your response on this, eagerly!

Thanks!

Revision history for this message
obiwan-92 (obiwan-92) said :
#6

@Rubynator
I'm sorry, but I don't know anything about the .skl.
The point of my question, however was just to find some workaround if the function is buggy.
I think python can easily produce a zip. But if you want to produce only a .skl, I can't help you.
So I let you with RaiMan.

Have a nice day.

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

In a private communication with Rubynator (at least I guess it was him ;-), i suggested the following workaround to import a .skl:

# get Sikuli’s Filemanager class
import org.sikuli.basics.FileManager as SFm
import os
# get the folderpath the main script is stored
scriptPath = os.path.join(os.path.dirname(os.path.dirname(getBundlePath())))
# get the folder path of a ….skl stored in the same folder (here sub.skl)
sub = os.path.join(scriptPath, "sub.skl“)
# unzip to temp folder (the only option here ;-)
subPath = SFm.unzipSKL(sub)
# put it on sys.path
sys.path.append(os.path.dirname(subPath))
# import it
import sub
# use it
….
# before exit delete it
SFm.deleteFileOrFolder(subPath)

This is necessary, since with the current Sikuli 1.0.1 the Jython 2.5 is bundled and the Python zip features are introduced with Python 2.6, so they are not available (so eventually they will be available with version 1.1.0 which comes with Jython 2.7beta1, that says to be on Python language level 2.7 - not checked yet)

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

Just found out, that it was not Rubynator, but Test (https://answers.launchpad.net/sikuli/+question/243323).

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

@Rubinator now
Just tested with Sikuli 1.0.1 on my Windows 8 64-Bit with the latest build version (12SEP…).

I had no problem with a running a .skl:

being in some folder:
run10/ contains the Sikuli 1.0.1 stuff
scripts/ contains the test scripts

run10\runIDE -r scripts\test.skl -d 3 -c

simply did what it should do.

So are there any specifics in your script, that depend on the fact, that it is run from the folder containing the .skl, because this will not work: a .skl is unzipped to a temp folder and run from there, so the usual folder environment of the respective .sikuli does not exist in this case.

Can you help with this problem?

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

To post a message you must log in.