ImportError ( No module named Process ) --- do not put other .sikuli folders in a .sikuli folder

Asked by tranquillo

Hallo,

i read all the other issues about not finding modules, but nothing helped me out.

[File Structure:]
 f:\AutomatedTesting\Sikuli\runsikulix.cmd
 f:\AutomatedTesting\Sikuli\MM2016\FirstTry.sikuli
 f:\AutomatedTesting\Sikuli\MM2016\FirstTry.sikuli\Process.sikuli

[from FirstTry.py:]
1| import Process
2| reload(Process)
3| Debug.user("Test beginnt")
4| Process.start()

[from Process.py:]
1| from sikuli import *
2| def start( ):
3| progPath = "foo"
4| Debug.user("start program: %s", progPath)

[full console output:] //i put runsikulix.cmd to windows PATH variable for more comfort

f:\AutomatedTesting\Sikuli\MusikMaker2016>f:\AutomatedTesting\Sikuli\runsikulix.cmd -r f:\AutomatedTesting\Sikuli\MM2016\FirstTry.sikuli
+++ running this Java
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
+++ trying to run SikuliX
+++ using: -Xms64M -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine -jar f:\AutomatedTesting\Sikuli\sikulix.jar -r f:\AutomatedTesting\Sikuli\MM2016\FirstTry.sikuli
Mär 24, 2016 10:54:28 AM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
[error] script [ F:\AutomatedTesting\Sikuli\MM2016\FirstTry.sikuli ] stopped with error in line 1
[error] ImportError ( No module named Process )

Note: With the Sikulix-IDE the script worked all fine!

best regards
rob

Question information

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

Pleas ignore the Java error!
I fixed this one via: https://www-01.ibm.com/support/docview.wss?uid=swg21496098

But the import error still remains.

Revision history for this message
tranquillo (rob-tranquillo) said :
#2

Found it by myself.

For scripts should set: addImportPath(myScriptPath)

I think the behaviour should be the same in the IDE as in the commandline. Because i develop in the IDE and run the scripts on the CI server.

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

It is not recommended currently to have any folders or other, that is not created by the SikuliX IDE, in a .sikuli. (there is a risk you might loose it in special cases).

... but other .sikuli, that are in the same folder as your main.sikuli are found automatically at import in all cases.