sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #55628
[Bug 1891779] Re: importError when running from commandline
globals is a Python internally reserved name and cannot be used as a
private module name.
use e.g. myGlobals.py
** Changed in: sikuli
Status: New => Invalid
** Changed in: sikuli
Assignee: (unassigned) => RaiMan (raimund-hocke)
--
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1891779
Title:
importError when running from commandline
Status in Sikuli:
Invalid
Bug description:
Hi!
I am using Sikulix 2.0.4 on Windows 10 64bit, JAVA 11.
My script, which imports some own modules, runs fine on IDE. but when
running from commandline it fails with the error:
importError ( No module named globals)
this is the .bat I am calling to start from commandline:
**********************
cd C:\temp\SikuliX\Play.sikuli
java -jar C:\temp\SikuliX\sikulixide-2.0.4.jar -r C:\temp\SikuliX\Play.sikuli
this is the main script:
import org.sikuli.script.SikulixForJython # I tried this without success
from sikuli import *
import os
import os.path
import sys
myPath = os.path.dirname(getBundlePath()) # I tried this without success
if not myPath in sys.path:
sys.path.append(myPath)
import globals
reload(globals)
this is globals (in the same directory as the main script):
******************
# -*- coding: utf-8 -*- # I need that, otherwise it wont import
from sikuli import *
import os
import os.path
import time
I also tried a workaround from bug #1504901 without sucess (very old
version)
Thanks in advance
Michael
To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1891779/+subscriptions
References