M
Modular•11mo ago
Kish

use of unknown declaration 'Python'

I get the following error message when writing a line of Code i got from Mojo Playground This is the line: let py = Python.import_module("bultins")
6 Replies
gryznar
gryznar•11mo ago
Have you performed import before? (from python import Python)
Kish
KishOP•11mo ago
yup
Xcur
Xcur•11mo ago
i think you just misspelled it it's supposed to be let py = Python.import_module("builtins")
Kish
KishOP•11mo ago
and @gryznar it was giving me an error when that line of code was outside of the main function but now i have it inside
fn main() raises:
let py = Python.import_module("builtins")
fn main() raises:
let py = Python.import_module("builtins")
gryznar
gryznar•11mo ago
main() function is required in Mojo 🙂
Kish
KishOP•11mo ago
goated!
Want results from more Discord servers?
Add your server