← Back to team overview

sikuli-driver team mailing list archive

[Question #265660]: My imports stopped working when I moved to newest version (sys.path issue?)

 

New question #265660 on Sikuli:
https://answers.launchpad.net/sikuli/+question/265660

Sorry if this has been answered, but I have looked and cannot find an answer for recent builds.

My imports worked all along until I upgraded to the most recent version.

Running windows7pro.
Referencing the SetupLog.txt, I can see that my last (working) version was "SikuliX Package Build: 1.1.0 2014-12-17_01:01nightly"
My current (problem) install shows "Setup: 1.1.0 2015-04-18_01:00nightly"

My development directories look like:

c:/projects/bin/sikuli/projectX.sikuli/
c:/projects/bin/sikuli/projectY.sikuli/
c:/projects/bin/sl/settings.py

Note "sl" in the same dir as "sikuli".
PYTHONPATH is C:\projects\bin

The scripts for projectX I developed with the last version of the IDE allowed me to:
from sikuli import *
import os, sys
import sl.settings as settings
...etc...

However, when I run the IDE, I now get...
[error] ImportError ( No module named sl )

I have tried to launch the IDE with 
C:\usrbin\sikulix\runsikulix.cmd -Dpython.path=C:/projects/bin

Still, the same error.
The only thing that seems to work is 

import org.sikuli.basics.SikulixForJython
from sikuli import *
import os, sys
sys.path.append(r'c:\projects\bin') # <-- THIS allows import to succeed
import sl.settings as settings

Putting a static path in all my scripts is really not an option -- that is what the sl.settings file is for!

So, how do I get that sys.path functionality back? 

That is, how can I either
1) Structure my files so that imports work for free -- like before
--or--
2) I can provide path info on the runsikulix.cmd command line

Thank You
forrest

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.