Skip to main content

Install Mojo

You can install Mojo as a Python or Conda package. This page shows you how to install using pixi, uv, pip, and conda, but you can use other tools.

System requirements:

Install

To get the latest version, we recommend installing our nightly build. If you want a better tested but older version, install the stable build. Both options are shown below.

  1. If you don't have it, install pixi:

    curl -fsSL https://pixi.sh/install.sh | sh
  2. Navigate to the directory where you want to create a project and run this:

    pixi init hello-world \
      -c https://conda.modular.com/max-nightly/ -c conda-forge \
      && cd hello-world

    This creates a project directory named hello-world, adds the channel for Modular conda packages, and enters the directory.

  3. Install Mojo:

    pixi add mojo
  4. Enter the virtual environment so you can access the mojo CLI:

    pixi shell

Verify your installation by printing the Mojo version:

mojo --version

Add the VS Code extension

If you're using Visual Studio Code or another IDE derived from it (such as Cursor), we recommend installing the Mojo extension, which provides features like syntax highlighting, code completion, and debugging support. You can install it from either:

Or, open the Extensions view in your IDE and search for "Mojo"—make sure you install the extension from Modular.

If you followed the installation steps above, your terminal should be in an environment with mojo installed. To run some code, you just need a .mojo file with a main() function:

  1. Create a file named hello.mojo with this code:

    hello.mojo
    def main():
        print("Hello, World!")
  2. Run it with the mojo CLI:

    mojo hello.mojo
    Hello, World!

Try some examples

The examples/mojo/ directory of our public GitHub repository contains several examples of Mojo code that you can use to learn more about the language and its standard library. Here's how to download and use them.

  1. Clone the repository:

    git clone https://github.com/modular/modular.git
  2. Navigate to one of the Mojo example subdirectories, such as the subdirectory containing the reference solution for the Get started with Mojo tutorial project, which is an implementation of Conway's Game of Life cellular automation:

    cd modular/examples/mojo/life
  3. Use pixi to download and install the dependencies for the project and to build and run the examples. For example, to run the reference solution for the Game of Life tutorial project, use the following command:

    pixi run lifev1

    This displays a window that shows an initial random state for the grid and then automatically updates it with subsequent generations. Quit the program by pressing the q or <Escape> key or by closing the window.

Update

The following commands should update your local mojo package if a new version is available that's compatible with the version you specified when you installed it or added it as a package dependency. For more information about updating packages, see the docs for your package manager.

pixi update mojo

Uninstall

Mojo is installed as a Python or Conda package, so the normal package removal process applies.

This removes the package from your local project:

pixi remove mojo

This deactivates your virtual environment:

exit

What's included

We actually offer two Mojo packages: mojo and mojo-compiler.

For most situation, you want mojo because it includes all the developer tools (it's a superset of the mojo-compiler package).

mojo

This gives you everything you need for Mojo development.

Includes:

mojo-compiler

This package is smaller and is useful for environments where you only need to call or build existing Mojo code. For example, this is good if you're running Mojo in a production environment or when you're programming in Python and calling a Mojo package—situations where you don't need the LSP and debugger tools.

Includes:

System requirements

To install mojo or mojo-compiler, your system must meet these specifications.

  • macOS Sequoia (15) or later
  • Apple silicon (M1/M2/M3/M4 processor)
  • Python 3.10 - 3.14
  • Xcode or Xcode Command Line Tools 16 or later
  • We have limited compatibility for Apple Silicon GPUs. You may need to run xcodebuild -downloadComponent MetalToolchain, which downloads the Metal utilities required for GPU programming in later versions of Xcode.

GPU compatibility

Mojo supports both CPUs and GPUs, so you don't need a GPU to program with Mojo. But if you do want to program for GPUs with Mojo, we recommend the following GPUs.

Because we don't test every variant of a GPU architecture, and support for new architectures will improve incrementally, we've divided our list of compatible GPUs into 3 tiers:

Tier 1: Fully supported

We provide full support and testing for the following data center GPUs:

  • NVIDIA B200 (Blackwell)
  • NVIDIA H100 and H200 (Hopper)
  • AMD Instinct MI355X (CDNA4)
  • AMD Instinct MI300X and MI325X (CDNA3)

Tier 2: Confirmed compatibility

We've confirmed full compatibility with the following GPUs but we don't maintain tests for them:

  • NVIDIA A100 and A10 (Ampere)
  • NVIDIA L4 and L40 (Ada Lovelace)
  • NVIDIA RTX 50XX series (Blackwell)
  • NVIDIA RTX 40XX series (Ada Lovelace)
  • NVIDIA RTX 30XX series (Ampere)
  • NVIDIA Jetson Orin and Orin Nano (Ampere)

Tier 3: Limited compatibility

We've either confirmed or received reports that the following GPUs work for GPU programming with Mojo. Some can also execute basic graphs with MAX APIs. However, none of these currently run major GenAI models with MAX:

  • Apple Silicon GPUs (M1 - M4)
  • NVIDIA RTX 20XX series (Turing)
  • NVIDIA T4 (Turing)
  • NVIDIA GTX 10XX series (Pascal)
  • NVIDIA Tesla P100 (Pascal)
  • AMD Radeon RX 9000 series (RDNA4)
  • AMD Radeon 800M series (RDNA3.5)
  • AMD Radeon 8050S / 8060S (RDNA3.5)
  • AMD Radeon 700M series (RDNA3)
  • AMD Radeon RX 7000 series (RDNA3)

If you've had success with any GPUs not listed here, please let us know on Discord.

GPU software requirements

Make sure you have the corresponding GPU software:

Was this page helpful?