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