anyone else having this problem?

Asked by eliteSKL

OS: Windows XP
Problem: From command line I cannot get this script to run. It will how ever it will run from the Sikuli-IDE.

error "can't find dependent libraries"

OS: Windows 7
the same script runs fine both in Sikuli-IDE and command line.

the script has a main file, a method file, and an image library. it basically saying to click the number one button on the calculator.

the files look like this:
___________
file # 1
___________

#mainfile
sys.path.append(r"C:\Documents and Settings\name\Desktop\mytestskl")
import myfunction

myfunction.mytest()

___________
file # 2
___________
#function file

from sikuli.Sikuli import *
setBundlePath(r"C:\Documents and Settings\name\Desktop\mytestskl\myimageLib.sikuli")
import myimageLib

def mytest():
        click(myimageLib.buttonOne)

___________
file # 3
___________
#imageLib file

from sikuli.Sikuli import *

buttonOne = Pattern().similar(0.96)

Question information

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

forgot to mention it sikuli-x

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

file # 1
___________

#mainfile
libPath = r"C:\Documents and Settings\name\Desktop\mytestskl"
if libPath not in sys.path: sys.path.append(libPath)
from myfunction import *

mytest()

___________
file # 2
___________
#function file
#has to be myfunktion.sikuli in the "libPath" directory

from sikuli.Sikuli import *
from myimageLib import *

def mytest():
        click(buttonOne)

___________
file # 3
___________
#imageLib file
# has to be myImageLib.sikuli in the "libPath" directory

from sikuli.Sikuli import *

buttonOne = Pattern().similar(0.96)

comments:
- from sikuli.Sikuli import * is needed in an imported file, if Sikuli features are needed
- when importing a .sikuli, the contained images are automatically available using their base filename (only "xyz.png"), no need for setting bundle path.
- if you assign image filenames/Patterns (or whatever) to variables, that you want to use in the importing script, use "from sub import * " and all the names are available in the current context without the need to qualify them like sub.name

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

@ "error "can't find dependent libraries"

which ..dll is reporting this error? Win32Util.dll?

paste first or last few lines of error.

Revision history for this message
eliteSKL (camaro70s) said :
#4

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py", line 23, in <module>
java.lang.UnsatisfiedLinkError: C:\Documents and Settings\name\Local Settings\Temp\tmplib\Win32Util.dll: Can't find dep
endent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.System.load(Unknown Source)
        at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44)
        at org.sikuli.script.Win32Util.<clinit>(Win32Util.java:14)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.sikuli.script.Env.getOSUtil(Env.java:82)
        at org.sikuli.script.App.<clinit>(App.java:4)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.python.core.SyspathJavaLoader.loadClass(SyspathJavaLoader.java:107)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.python.core.Py.findClassEx(Py.java:817)
        at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:133)
        at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:28)
        at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:122)
        at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:137)
        at org.python.core.PyObject.__findattr__(PyObject.java:869)
        at org.python.core.imp.import_name(imp.java:771)
        at org.python.core.imp.importName(imp.java:806)
        at org.python.core.ImportFunction.__call__(__builtin__.java:1232)
        at org.python.core.PyObject.__call__(PyObject.java:367)
        at org.python.core.__builtin__.__import__(__builtin__.java:1202)
        at org.python.core.imp.importFromAs(imp.java:884)
        at org.python.core.imp.importFrom(imp.java:860)
        at sikuli.Sikuli$py.f$0(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py:183)
        at sikuli.Sikuli$py.call_function(C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.imp.createFromCode(imp.java:326)
        at org.python.core.util.importer.importer_load_module(importer.java:109)
        at org.python.modules.zipimport.zipimporter.zipimporter_load_module(zipimporter.java:161)
        at org.python.modules.zipimport.zipimporter$zipimporter_load_module_exposer.__call__(Unknown Source)
        at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47)
        at org.python.core.imp.loadFromLoader(imp.java:451)
        at org.python.core.imp.find_module(imp.java:408)
        at org.python.core.PyModule.impAttr(PyModule.java:109)
        at org.python.core.imp.import_next(imp.java:637)
        at org.python.core.imp.import_logic(imp.java:699)
        at org.python.core.imp.import_name(imp.java:761)
        at org.python.core.imp.importName(imp.java:806)
        at org.python.core.ImportFunction.__call__(__builtin__.java:1232)
        at org.python.core.PyObject.__call__(PyObject.java:367)
        at org.python.core.__builtin__.__import__(__builtin__.java:1202)
        at org.python.core.__builtin__.__import__(__builtin__.java:1185)
        at org.python.core.imp.importAll(imp.java:904)
        at org.python.pycode._pyx2.f$0(<string>:1)
        at org.python.pycode._pyx2.call_function(<string>)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.Py.runCode(Py.java:1204)
        at org.python.core.Py.exec(Py.java:1248)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:172)
        at org.sikuli.script.ScriptRunner.runPython(ScriptRunner.java:52)
        at org.sikuli.script.ScriptRunner.runPython(ScriptRunner.java:87)
        at org.sikuli.ide.SikuliIDE.runSikuli(SikuliIDE.java:635)
        at org.sikuli.ide.SikuliIDE.main(SikuliIDE.java:723)

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: C:\Documents and Settings\name\Local Settings\Temp\tmpl
ib\Win32Util.dll: Can't find dependent libraries

Revision history for this message
eliteSKL (camaro70s) said :
#5

the interesting thing is i have tried two different scripts. that have both a main file, a class/function file, and an image library file. both run fin in the IDE on the WIndows XP machine. Both run fine on the Windows 7 machine in both IDE and console window.

i check my environment path it seems to be correct. i can launch Sikuli from cmd and run screen. but the problem happens when i just want to run form command line.

i use this command line: sikuli-ide.bat -r "script.sikuli" -s

in both OS's.
what am i missing? it's got to be something simple right?

Is' there a planned fix for the import module's where we don have to shut down the IDE to re-run scripts after tweaking them? hehehe i was going to us command line and Vim to do all my work but command line is acting weird.

Revision history for this message
eliteSKL (camaro70s) said :
#6

edit post above for clearity

****
the interesting thing is i have tried two different scripts. that have both a main file, a class/function file, and an image library file. both scripts run fine in the IDE on the WIndows XP machine, but not in console. Both run fine on the Windows 7 machine in both IDE and console window.
*****

Revision history for this message
Tsung-Hsiang Chang (vgod) said :
#7

Try to add the path to your JRE\bin to the environment variable PATH.

Revision history for this message
eliteSKL (camaro70s) said :
#8

thanks Tsung-Hsiang, that fixed my problem. i must have deleted it when i was messing around in my environment paths, last time.