New question #697968 on SikuliX:
https://answers.launchpad.net/sikuli/+question/697968

I have a structure of multi-sikuli-modules set up, with an "API" module that 
makes use of an external module ( 'requests'), i.e.:
 - test1.sikuli
 - test2.sikuli
 - API.sikuli -> tools.py has `import requests` 

I also have set up a, so to say, entry point, "framework.sikuli", that 
sequentially loads my modules and then launches them:
```
test_modules = [
    r"../API.sikuli",
    r"../test1.sikuli",
    r"../test2.sikuli"]

for module in test_modules:
     if not module in sys.path:
         sys.path.append(module)
    module = path_leaf(module).replace(".sikuli", "")
    print("Loading Module %s " % module)
    module_obj = __import__(module)
    globals()[module] = module_obj
```

If I remove the "API.sikuli" from test_modules array, when I run the 
framework.sikuli it fails afterwards (because test1 and test2 need the API), 
but having it there I get this error:
Loading Module API 
[error] script [ test_framework ] stopped with error in line 220
[error] ImportError ( !!WHILE IMPORTING!! No module named requests )
[error] --- Traceback --- error source first
line: module ( function ) statement 
5: API (  <module> )     import requests
220: main (  <module> )     module_obj = __import__(module)
[error] --- Traceback --- end --------------


What am I doing wrong?

Thank you 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

Reply via email to