sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #57415
Re: [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)
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 10000s 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.