Region.exists: seems that imagefile could not be found on disk

Asked by Balsa

So I made a simple script to do a few things on my computer automatically and I used it for days without any problems. Now suddenlly on a couple calls for exists function where the arguments are those small screenshots I get this message. It's very strange because there are more of these exists with screenshots and they work fine. I checked the folder where they're located and everything is in order, so no clue what to do about this.

Any advice ?

thx

Question information

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

what version? what system?
what exactly is the error?

... and the first question in those cases always is:
what changed between the last successful run and the first error situation?

Revision history for this message
Balsa (baki-a) said :
#2

It is the latest stable release of Sikuli 1.0.1. I am usnig Widnows Vista.
The exact error is the one I put in the title "[error]Region.exists: seems that imagefile could not be found on disk".

And as I mentioned the odd thing is that nothing actually changed between the last successful run and the first error situation.

thx

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

then run from command line:
java -jar <path-to>sikuli-ide.jar -d 3 -c -r <path-to>you-name-it.sikuli

take care, that no other characters than letters, numbers, hyphen or underscore are in the script path.

look at the debug output, wether something obvious is reported.

BTW: did you move the script to another place, that might have a "bad" path?

Revision history for this message
Balsa (baki-a) said :
#4

Ok so I run the debug as you said, and something did pop up, the enviorment PATH problem. I am pasting the debug report here, so do you think that anything could be done based on this?

C:\Users\Shinavatra\SikuliX>java -jar C:\Users\Shinavatra\SikuliX\sikuli-ide.jar
 -d 3 -c -r C:\Users\Shinavatra\LGScript.sikuli
[debug] SikuliX: []
[debug] SikuliIDE: Switching to SikuliScript with option -r, -t or -i
[debug] SikuliScript: CmdOrg: null
[debug] Running on Java 8 (1.8.0_31-b13)
[debug] --- Sikuli parameters ---
[debug] 1: -d
[debug] 2: 3
[debug] 3: -c
[debug] 4: -r
[debug] 5: C:\Users\Shinavatra\LGScript.sikuli
[debug] SikuliScript: givenScriptName: C:\Users\Shinavatra\LGScript.sikuli
[debug] SikuliX Jython Support Build: 1.0.1 12SEP2013160248
[debug] Trying to run script: C:\Users\Shinavatra\LGScript.sikuli\LGScript.py
[debug] JythonScriptRunner: : executeScriptHeader: adding SikuliX Lib path to sy
s.path
C:\Users\Shinavatra\SikuliX\sikuli-ide.jar\Lib
[debug] Jython: sikuli: __init__: entering
[debug] Jython: sikuli: Sikuli: entering
[debug] Jython: sikuli: Sikuli: constants
[debug] Jython: sikuli: Sikuli: import Region
[debug] Jython: sikuli: Sikuli: import Screen
[debug] Jython: sikuli: Sikuli: Env.addHotkey
[debug] Jython: sikuli: Sikuli: import Match
[debug] Jython: sikuli: Sikuli: import Pattern
[debug] Jython: sikuli: Sikuli: import Location
[debug] Jython: sikuli: Sikuli: import ScreenUnion
[debug] Jython: sikuli: Sikuli: import Finder
[debug] ResourceLoaderBasic: SikuliX Package Build: 1.0.1 12SEP2013160242
[debug] ResourceLoaderBasic: check: we are running on arch: x86
[debug] ResourceLoaderBasic: check: using Java at: C:/Program Files (x86)/Java/j
re1.8.0_31/
[debug] ResourceLoaderBasic: check: Exists libs folder at location of jar? YES:
C:/Users/Shinavatra/SikuliX/
[debug] ResourceLoaderBasic: checkLibsDir: C:/Users/Shinavatra/SikuliX/libs
[error] ResourceLoaderBasic: checkLibsDir: libs dir is not on system path: C:\Us
ers\Shinavatra\SikuliX\libs
C:\ProgramData\Oracle\Java\javapath
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\FPC\2.6.4\bin\i386-Win32
C:\Users\Shinavatra\Anaconda3
C:\Users\Shinavatra\Anaconda3\Scripts
C:\Program Files (x86)\Java\jre1.8.0_31\/bin
[action] ResourceLoaderBasic: checkLibsDir: Please wait! Trying to add it to use
r's path
[debug] ResourceLoaderBasic: runcmd: reg QUERY HKCU
[info] runcmd: reg QUERY HKCU
[debug] ResourceLoaderBasic: runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v
PATH
[info] runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v PATH
[debug] ResourceLoaderBasic: checkLibsDir: current:(HKEY_CURRENT_USER\Environmen
t PATH): C:\Users\Shinavatra\Anaconda3;C:\Users\Shinavatra\Anaconda3\Scripts;%JA
VA_HOME%/bin
[debug] ResourceLoaderBasic: runcmd: reg ADD HKEY_CURRENT_USER\Environment /v PA
TH /t REG_EXPAND_SZ /f /d C:\Users\Shinavatra\SikuliX\libs;C:\Users\Shinavatra\A
naconda3;C:\Users\Shinavatra\Anaconda3\Scripts;%JAVA_HOME%/bin
[info] runcmd: reg ADD HKEY_CURRENT_USER\Environment /v PATH /t REG_EXPAND_SZ /f
 /d C:\Users\Shinavatra\SikuliX\libs;C:\Users\Shinavatra\Anaconda3;C:\Users\Shin
avatra\Anaconda3\Scripts;%JAVA_HOME%/bin
[debug] ResourceLoaderBasic: checkLibsDir: The operation completed successfully.

[debug] ResourceLoaderBasic: runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v
PATH
[info] runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v PATH
[debug] ResourceLoaderBasic: checkLibsDir: Changed to: HKEY_CURRENT_USER\Environ
ment
    PATH REG_EXPAND_SZ C:\Users\Shinavatra\SikuliX\libs;C:\Users\Shinavatr
a\Anaconda3;C:\Users\Shinavatra\Anaconda3\Scripts;%JAVA_HOME%/bin

[error] ResourceLoaderBasic: checkLibsDir: Successfully added the libs folder to
 users PATH!
RESTART all processes/IDE's using Sikuli for new PATH to be used!/nFor usages fr
om command line logout/login might be necessary!
[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

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

the hint, what you should do is a bit hidden and hard to understand:

RESTART all processes/IDE's using Sikuli for new PATH to be used!
For usages from command line logout/login might be necessary!

So just do what it tells you here.

If you do not understand at all, what you should do:
just restart the machine and try again.

Revision history for this message
Balsa (baki-a) said :
#7

Thanks RaiMan, that solved my question.