Skip to main content
Log in

Install MAX

As shown below, you can install MAX as a conda package using magic—a virtual environment manager that supports both conda and PyPI packages. But if you just want to start building stuff, instead check out our tutorials, which also show how to install MAX.

Install Magic

Magic is a package manager and virtual environment tool that builds upon the conda and PyPI packaging ecosystems to ensure that your MAX and Mojo builds are consistent and reproducible.

You can install the magic CLI on macOS and Ubuntu Linux with this command:

curl -ssL https://magic.modular.com/ | bash
curl -ssL https://magic.modular.com/ | bash

Then run the source command that's printed in your terminal.

Install a stable build

For most projects, we recommend installing our latest stable release. You can also select which version you want, and magic makes it easy to install a different version of MAX for each project. (Each MAX version is described in the MAX changelog.)

For example, here's how to create a new project and install MAX:

  1. Create a my-project directory with magic init:

    magic init my-project --format pyproject
    magic init my-project --format pyproject
  2. Install MAX with magic add:

    cd my-project
    cd my-project
    magic add max
    magic add max

    This ensures that you always have the latest version of MAX.

    Or, you can specify the version using Python version operators. For example, here's how to pin your project to version 24.6:

    magic add "max==24.6"
    magic add "max==24.6"

That's it. You just installed MAX for your project's virtual environment.

You can check the installed max version like this:

magic run python3 -c 'from max import engine; print(engine.__version__)'
magic run python3 -c 'from max import engine; print(engine.__version__)'
24.6.0
24.6.0

To learn more about how to manage your packages and interact with the Magic virtual environment, see the Magic documentation.

Install a nightly build

Nightly builds give you access to the bleeding-edge version of MAX. These builds include new features, but they're not fully tested, so they might include new bugs. Fortunately, you can safely try a nightly build in one project without affecting your other projects, because every project you create with magic has its own package dependencies.

To install a nightly build, you just need to modify your project configuration to install max from the nightly channel: https://conda.modular.com/max-nightly/.

For example, here's how to create a project with a nightly build:

  1. Create a new project and specify the max-nightly channel with the magic init -c option:

    magic init nightly-project --format pyproject \
    -c conda-forge -c https://conda.modular.com/max-nightly
    magic init nightly-project --format pyproject \
    -c conda-forge -c https://conda.modular.com/max-nightly

    When you include the -c (--channel) option, you must specify all channels for your project. Be sure to include conda-forge (or another conda channel) to install packages other than MAX.

    Or, manually edit the default max channel to use max-nightly. Either way, the pyproject.toml file in your project should include this:

    pyproject.toml
    [tool.pixi.project]
    channels = ["conda-forge", "https://conda.modular.com/max-nightly/"]
    [tool.pixi.project]
    channels = ["conda-forge", "https://conda.modular.com/max-nightly/"]
  2. Install MAX with magic add:

    cd nightly-project
    cd nightly-project
    magic add max
    magic add max

You should see the nightly version name with the build date. For example:

✔ Added max >=24.6.0.dev2024111705,<25
✔ Added max >=24.6.0.dev2024111705,<25

Uninstall MAX

If you installed MAX with magic, just delete the project paths that you created with magic init (paths with a pyproject.toml, mojoproject.toml, or pixi.toml file).

To remove the magic tool, delete the magic binary:

rm ~/.modular/bin/magic
rm ~/.modular/bin/magic

That's it.

Next steps