Hi,
I am trying to import some libraries in the HLA. Easily accomplished, or so I thought, by
- Putting a
lib
folder next to my script pip install -r requirements.txt --target lib
sys.path.append(str(Path(__file__).parent.absolute() / 'lib'))
And it is in fact easily accomplished. But the trouble apparently starts when the module I import wants to import something else. It seems all second level imports fail.
HighLevelAnalyzer.py", line 21, in <module>
from construct import Struct
File "C:\Program Files\Logic\resources\windows\pythonlibs\lib\site-packages\saleae\_module_space.py", line 244, in load_module
self._inner_loader.exec_module(module)
File "C:\project\lib\construct\__init__.py", line 22, in <module>
from construct.core import *
As you can see it could apparently find lib/construct/__init__.py
but that’s when it gets amnesia.
My investigation came to a stop when I found Program Files\Logic\resources\windows\pythonlibs\lib\site-packages\saleae\_module_space.py
and realize you somehow are doing this on purpose.
The tip at Third party libraries with HLAs - #5 by bruff seems to be what I tried above, but that is a couple years old now.
Is there any way I can successfully import things? I don’t really care how much extra boilerplate I need so long as it works in the end.
Best regards