I created and uploaded a python library It works if I add all files at the root level, eg:

/bar.py

And then use it in my algorithm's main.py:

from bar import Market

 

But it does not work if I add the library in a subdirectory, eg:

/foo/__init__.py
/foo/bar.py

And then use it in my algorithm's main.py:

from foo.bar import Market


Which causes the error:

Build Error: File: main.py Line:1 Column:0 - ModuleNotFoundError: No module named 'foo'

How can my algorithms access directories in my modules/libraries?