MAX packages
You can install MAX as a conda package using magic
—a package
manager and virtual environment manager that supports both conda and PyPI
packages. In the following sections, you'll see how to add the max
package to
a new project, using either our stable or nightly build.
If you just want to try MAX quickly, instead see Get started with MAX. For more in-depth tutorials to deploy and build with MAX, check out our tutorials, which also show how to install MAX.
Stable release
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:
-
If you don't have the
magic
CLI yet, you can install it 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. -
Create a
my-project
directory withmagic init
:magic init my-project --format pyproject
magic init my-project --format pyproject
-
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.
Nightly release
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:
-
If you don't have the
magic
CLI yet, you can install it 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. -
Create a new project and specify the
max-nightly
channel with themagic init -c
option:magic init nightly-project --format pyproject \
-c conda-forge -c https://conda.modular.com/max-nightlymagic init nightly-project --format pyproject \
-c conda-forge -c https://conda.modular.com/max-nightlyWhen you include the
-c
(--channel
) option, you must specify all channels for your project. Be sure to includeconda-forge
(or another conda channel) to install packages other than MAX.Or, manually edit the default
max
channel to usemax-nightly
. Either way, thepyproject.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/"] -
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
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!