M
Modular•10mo 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•10mo ago
Have you performed import before? (from python import Python)
Kish
KishOP•10mo ago
yup
Xcur
Xcur•10mo ago
i think you just misspelled it it's supposed to be let py = Python.import_module("builtins")
Kish
KishOP•10mo 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•10mo ago
main() function is required in Mojo 🙂
Kish
KishOP•10mo ago
goated!
Want results from more Discord servers?
Add your server