cannot import module in vscode #810
-
I'm new to mojo, I setup a mojo project with all the mojo files in the same dir. following the offical manual, I create a module file mymodule.mojo :
and try to import mymodule in the main.mojo file
but when I tried to run the main.mojo, error occurs:
do I miss any steps or configurations? please help. |
Beta Was this translation helpful? Give feedback.
Answered by
drunkwcodes
Sep 15, 2023
Replies: 1 comment 1 reply
-
You may make a directory like this:
And use relative import in However I think your approach should work. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ivyy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You may make a directory like this:
And use relative import in
main.mojo
:from .mymodule import MyPair
However I think your approach should work.
It can be an issue.