Module loading error

I have a module with a following file structure as shown in the attached images. In the types folder there is an __init__.mojo file that imports the main type/function in the submodules for pretty importing by the user. The submodules similarly contain an _init_.mojo that imports the associated type/function so the main init can also cleanly import said type/function. This, however, is an issue according to Mojo. Attempting to compile this gives the following issue:
types/__init__.mojo:1:6: error: unable to locate module 'array'
from array import Array
^
mojo: error: failed to parse the provided Mojo
types/__init__.mojo:1:6: error: unable to locate module 'array'
from array import Array
^
mojo: error: failed to parse the provided Mojo
No description
No description
4 Replies
TeamPuzel
TeamPuzel15mo ago
I was told the init file may not contain anything yet It's working for you?? I think you need to have a dot if something is within the same folder, like from .array import Array
Moosems / Three chickens
GitHub
Mojo-Types/types/array/init.mojo at main · Moosems/Mojo-Types
I created some useful types for use in Mojo. Contribute to Moosems/Mojo-Types development by creating an account on GitHub.
Moosems / Three chickens
That passed the automated tests. Fixed it!
TeamPuzel
TeamPuzel15mo ago
Yeah I had issues with this before too.
Want results from more Discord servers?
Add your server