Are Python codes written in mojo file compiled to native image?
or not compiled and requiring CPython to be installed on the computer running mojo program?
4 Replies
If you write valid python code which is also valid mojo code in a .mojo file it gets compiled into a binary. Importing python packages requires you to have the cpython interpreter installed
Are the packages I imported also get compiled to binary?
Or do we need CPython installed on our computer to use the program importing Python packages?
Cpython and the relevant python packages need to be installed to run a mojo program that imports python packages. Those don't get compiled
I am running mojo on Ubuntu. I've just checked inside the .modular folder and found venv environment in it. So, I am guessing modular either ships python with 'modular cli' or creates a python env based off of installed python version on the system.