Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
--- my repacked SikuliX IDE jar
for the sites.txt solution, there is no need to pack anything into the SikuliX 
IDE jar.
A path given in sites.txt is simply added to sys.path at runtime init.

for your cases where are you putting the sites.txt file so that it is picked up 
when running the scripts?
I put it here originally as per the instructions in the docs
C:\Users\richardc\AppData\Roaming\Sikulix\Lib\site-packages
but this didn't work.
The only thing that worked was to put it in
sikulixide-2.0.5\Lib\site-packages
and run 
Sikulix.buildJarFromFolder("F:\Autotester\New Sikuli\sikulixide-2.0.5.jar", 
"F:\Autotester\New Sikuli\sikulixide-2.0.5")
to create a new jar file with it in and use that in place of the original 2.0.5 
IDE jar

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
just sent you an email

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #247134]: "from org.sikuli.script.natives import Vision" statement not working

2021-07-23 Thread Richard Chubb
Question #247134 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/247134

Richard Chubb posted a new comment:
also does not work for 2.0.5.

Where is vision now located?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
Hi, thanks for that RaiMan.
With the hardcoded path in sites.txt, in my repacked SikuliX IDe jar, the 
common modules were imported.
although now I have a new different fail, below. unrelated to this issue I 
suspect, so I will scan the docs and existing questions for a solution.
--
[error] script [ design_loading1 ] stopped with error in line 2
[error] ImportError ( !!WHILE IMPORTING!! No module named natives )
[error] --- Traceback --- error source first
line: module ( function ) statement 
2: commonFunctions (   ) from org.sikuli.script.natives import 
Vision
2: main (   ) from commonFunctions import *
[error] --- Traceback --- end --
--


Thanks for your feedback and response
"Supposing you are using the SikuliX IDE jar, I will create a modified 2.0.5 
version until monday for you, that accepts"
Yes I am using the SikuliX IDE jar.

"In 2.0.6 I will add this as a basic solution (allowing more than 1 path 
separated by ; or :) and additionally the sites.txt accepting relative paths to 
the working folder and with %...% variables taken from current environment."
Both these solutions would be a great option.

thanks for your prompt feedback and the effort in supplying a solution

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
The sites_examples.txt states
# rename/copy this file as sites.txt and it will be seen by SikuliX
#
# add absolute paths one per line, that point to other directories/jars,
# where importable modules (Jython, plain Python, SikuliX scripts, ...) can be 
found.
# They will be added automatically at startup to the end of sys.path in the 
given sequence
#
# lines beginning with # or // are ignored and can be used as comments

but I can't use absolute paths, because the tests/scripts are run on different 
machines.
Can I use a defined env var e.g. %NCS_SIKULI_COMMON% ?

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


Re: [Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-23 Thread Richard Chubb
Question #698112 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/698112

Richard Chubb posted a new comment:
Thanks for the feedback RaiMan.

"
I have 3 solutions:
--- JYTHONPATH
Set it in the environment and use the python features to extract it at runtime

--- parameter
add the path as parameter after -- to the command line

... in both cases you can now add the path to sys.path at runtime

--- site-packages
see 
https://sikulix-2014.readthedocs.io/en/latest/scenarios.html#access-python-packages-from-sikulix-scripts-run-by-sikulix-gui-or-commandline
"

for the first point:
do you mean set it up in system/user environment variables? If so this is not a 
viable solution. These are autotests/regession tests that are run on all sort 
of machines and we can't rely on env vars set on each machine, so we have to 
set up any env vars in the scripts every time a test is run, which is why I was 
trying to use 'set JYTHONPATH..'.

What do you mean by 'extract it at runtime'?
do you mean in the actual sikuli script? Again this is not a viable solution as 
there a 1s of scripts that would need changing, I need a common soultion.

for the second point:
can you please explain what you mean with an example perhaps?
do you mean add it as optional command line parameter?

'in both cases you can add the path to sys.path at runtime'
if you mean in the sikuli scripts themselves, then as above that is not a 
viable solution as I need a common solution.

For the third point:
I did start looking into this, but I ran into some difficulties.
I added the path to sites.txt  in the app data location but that was not 
getting copied to the scripts lib location.
I think the scripts copy of sikulix and the lib folder is coming from the .jar 
file.
I tried to add this in but I do not know the metho to add to a .jar file, I can 
extract the .jar using 7-zip but I couldn't find out how to create the new .jar 
after adding the file in.
I did have a look at that page that you linked to , but will take another look 
because it looks like it may be able to tell me how to repack the .jar.


thanks in advance

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

___
Mailing list: https://launchpad.net/~sikuli-driver
Post to : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp


[Sikuli-driver] [Question #698112]: Windows 10: imports no longer working after moving to newest version (run from comand line, sys.path not containing location of common modules)

2021-07-22 Thread Richard Chubb
New question #698112 on SikuliX:
https://answers.launchpad.net/sikuli/+question/698112

I am having the same issue as in 
https://answers.launchpad.net/sikuli/+question/265660
I have followed the suggestions in that question but it has not resolved my 
issue.

I get the following error

--
[error] script [ design_loading1 ] stopped with error in line 3
[error] ImportError ( No module named commonFunctions )
[error] --- Traceback --- error source first
line: module ( function ) statement 
3: main (   ) from commonFunctions import *
[error] --- Traceback --- end --
-

I was previously using sikuli(x) 1.0.0 and wanted to upgrade to the latest 
version to take advantage of some of the newest features (including the OCR).

Previously the scripts were run from a .bat/.cmd file that issued a command 
line to run the sikilu-script.jar, but I see that this is no longer used and 
that I should be using the  new sikuli-ide.jar for running a script from the 
command line.

The previous command issued was :

"C:/Program Files (x86)/\Java\jre1.8.0_271\bin\java.exe" -Xms64M -Xmx512M 
-Dfile.encoding=UTF-8
-Dpython.path=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts
  -jar 
"C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikuli-script.jar"
 -r 
C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/ncs_vbp_p/start/SikuliScripts/design_loading1.sikuli
  

where Dpython.path is the location of the common scripts.

Trying to run the exact same script using the new version (2.0.5) and the 
command I use is the following:

"C:\Program Files\Java\jre1.8.0_291\bin\java.exe" -Xms64M -Xmx512M 
-Dfile.encoding=UTF-8
-Dpython.path=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts
  -jar 
"C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikulixide-2.0.5.jar"
 -r 
C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/ncs_vbp_p/start/SikuliScripts/design_loading1.sikuli

I have tried setting up the PYTHONPATH, JYTHONPATH and CLASSPATH but this had 
no affect.

I turned on debugging and here is the output (with some unnecessary logging 
trimmed from the start)
--

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>set 
PYTHONPATH=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts;
 

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>set 
JYTHONPATH=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts;
 

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>set 
CLASSPATH=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts; 

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>echo 
+++ trying to start Sikuli Script 
+++ trying to start Sikuli Script

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>rem 
TODO: running as jar: java.lang.NoClassDefFoundError: 
org/sikuli/script/SikuliScript 

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>if 
defined J6 goto ONJAVA6 

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>echo 
not java6 
not java6

C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1>"C:\Program
 Files\Java\jre1.8.0_291\bin\java.exe" -Xms64M -Xmx512M -Dfile.encoding=UTF-8   
 
-Dpython.path=C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/utils/SikuliScripts
  -jar 
"C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikulixide-2.0.5.jar"
 -r 
C:/Users/richardc/dev/eCS21_1_tpmgr/ncs_autotest/ncs_vbp_p/start/SikuliScripts/design_loading1.sikuli
  -v -d 3 -c 

[DEBUG]startUp: IDE: Running: 
C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikulixide-2.0.5.jar
[DEBUG]startUp: IDE: AppData: 
C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1\Sikulix
[DEBUG]startUp: IDE: starting with classpath: 
C:\Users\richardc\dev\eCS21_1_tpmgr\ncs_autotest\utils\Sikuli\sikulixide-2.0.5.jar
 ...
[DEBUG]startUp: IDE: no extensions.txt nor valid content
[error] FileManager: writeStringToFile: did not work: 
C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1\Sikulix\SikulixStore\lastUsedJar.txt
C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1\Sikulix\SikulixStore\lastUsedJar.txt
 (The system cannot find the path specified)
[1017 debug] RunTime:temp folder ok: 
C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1\temp\Sikulix_935754622
Options: *** options dump
Options: testing = 
Options: OptionsFile = 
C:\Users\richardc\dev\eCS21_1_tpmgr\results\ncs_vbp_p\design_loading\test1\Sikulix\SikulixStore\SikulixOptions.txt
Options: *** options dump end
* show environment for 2.0.5 API
user.home: C:\Users\richardc
work