I am trying out Mojo by Modular and more specifically having a look at the Mandelbrot.ipynb available here. When running the line np = Python.import_module("numpy") I get the rather odd error Error: An error occurred in Python.. I have had a look around and only found this open issue. Has anyone experienced the same issue previously and reached a solution? Thanks in advance!
2 Answers
try to make sure you have numpy installed, or check the compatibility of mojo with your python version and Review the code in the Mandelbrot.ipynb notebook aware. Make sure there are no syntax errors or logical problems in your code that could cause the error.
2 Comments
Ivar Eriksson
My packages were not installed in my python environment. Should have thought of that sooner 😅
Luca Micarelli
Don't worry, it happens to everyone, I'm happy to have helped you ;)
Can we use virtual environments with Mojo, or is it better to install the packages in global python packages?
Edit: I just found that Mojo provides a dockerfile, found here, https://github.com/modularml/mojo/blob/main/examples/docker/Dockerfile.mojosdk.
mojotag doesn't have anything to do with Python, I changed it tomojolangfor you.modularcould mean lots of different things, and in fact the tag wiki appears to be empty.