As of the 25.3 release, there’s a new way to install Modular’s platform: pip install modular
. This took a bit of work, and should make it even easier to integrate MAX and Mojo into existing Python-based workflows. Both stable release packages and nightly ones are available, with nightly packages being released at the same time as all other nightly deployments.
To install and use within a Python virtual environment, it’s as simple as
python3 -m venv pip-modular
source pip-modular/bin/activate
pip install modular --extra-index-url https://download.pytorch.org/whl/cpu
This will install the latest stable release of MAX and Mojo (25.3, as of this writing) into a virtual environment, where you can call mojo file.mojo
or python my_graph.py
and have full access to Mojo and MAX.
The --extra-index-url https://download.pytorch.org/whl/cpu
portion is a temporary workaround to reduce the size of the installation by preventing PyTorch’s GPU dependencies from being installed on a GPU-enabled system. That should go away soon.
Nightly releases are available on a separate packaging channel, to install those packages use
pip install modular --index-url https://dl.modular.com/public/nightly/python/simple/ --extra-index-url https://download.pytorch.org/whl/cpu
From the nightlies, you can also pin to a specific nightly release using modular==[version]
.
The modular
package is a meta-package that installs all of Modular’s software platform. It currently has one sub-package, max
, which can be installed in isolation if you do not need the support for AI models or serving. It is our plan to make finer-grained packages available under this umbrella, but modular
will always get you everything Modular has to offer.
This is a new distribution channel, so there are some small issues that are being worked on:
- The VS Code extension doesn’t currently use an LSP corresponding to the version of Mojo in a Python virtual environment. For full syntax highlighting and editor integration when working with Mojo code, we currently recommend using Magic to configure a project environment.
- The Mojo debugger is not yet distributed via the PyPI packages.
- The need for
--extra-index-url https://download.pytorch.org/whl/cpu
when installingmodular
to reduce the size of the installed packages is a temporary workaround, and will go away in a future package.
If you have questions about this new distribution mechanism, feel free to ask below, and / or provide feedback on what you think about it. We’re really excited about this new way of getting MAX and Mojo!