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:
4 Replies
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
Yeah? It works fine for me: https://github.com/Moosems/Mojo-Types/blob/main/types/array/__init__.mojo
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.
That passed the automated tests.
Fixed it!
Yeah I had issues with this before too.