SDK Module load error

Hi @chris,

I’ve been playing around with the SDK and came across this error - have you got any idea what’s going wrong here?

I can work around it as calling the method this way works fine, but would be good to understand what’s going on.

Thanks,
Charlie

Hi @charlie.brooker,

This is how I would do it.

from ladybug_comfort import adaptive
help(adaptive)

ladybug_comfort is the whole package. When you import it as a module it will reference to the __init__.py file in the package. And there is no adaptive module inside that file. Try this code.

import ladybug_comfort as lc
print(lc.__file__)

The reason that the first example works is that adaptive is a module inside ladybug_comfort and it is linked to ladybug_comfor/adaptive.py.

Python packaging is a bit strange! :slight_smile:

2 Likes