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.
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.
- pixi
- uv
- pip
- conda
-
If you don't have it, install
pixi
:curl -fsSL https://pixi.sh/install.sh | sh
-
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. -
Install Mojo:
- Nightly
- Stable
pixi add mojo
pixi add "mojo=25.5"
-
Enter the virtual environment so you can access the
mojo
CLI:pixi shell
-
If you don't have it, install
uv
:curl -LsSf https://astral.sh/uv/install.sh | sh
Then restart your terminal to make uv accessible.
-
Create a project:
uv init hello-world && cd hello-world
-
Create and start a virtual environment:
uv venv && source .venv/bin/activate
-
Install Mojo:
- Nightly
- Stable
uv pip install mojo \ --index-url https://dl.modular.com/public/nightly/python/simple/ \ --prerelease allow
Stable builds aren't on pypi.org yet. Either install nightly or switch to Pixi or Conda.
-
Create a project folder:
mkdir hello-world && cd hello-world
-
Create and activate a virtual environment:
python3 -m venv .venv/hello-world \ && source .venv/hello-world/bin/activate
-
Install Mojo:
- Nightly
- Stable
pip install --pre mojo \ --index-url https://dl.modular.com/public/nightly/python/simple/
Stable builds aren't on pypi.org yet. Either install nightly or switch to Pixi or Conda.
-
If you don't have it, install conda. A common choice is to use Homebrew:
brew install miniconda
-
Initialize conda for shell interaction:
conda init
If you're on a Mac, instead use:
conda init zsh
Then restart your terminal for the changes to take effect.
-
Create a project:
conda create -n hello-world
-
Start the virtual environment:
conda activate hello-world
-
Install Mojo:
- Nightly
- Stable
conda install -c conda-forge \ -c https://conda.modular.com/max-nightly/ mojo
conda install -c conda-forge \ -c https://conda.modular.com/max/ mojo
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.
There are currently two extensions:
- Mojo (nightly) extension: For projects using the nightly build.
- Mojo (stable) extension: For projects using the stable build.
Follow the corresponding link above and click Install. Or, open the Extensions view in VS Code and search for "Mojo"—make sure you install the extension from Modular.
Print "Hello world"
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:
-
Create a file named
hello.mojo
with this code:hello.mojodef main(): print("Hello, World!")
-
Run it with the
mojo
CLI:mojo hello.mojo
Hello, World!
Try some examples
We have a bunch of code examples on GitHub. Here's how to use them:
-
Clone the repo:
git clone https://github.com/modular/modular.git
If you installed the stable version, make sure you check out the
stable
GitHub branch (themain
branch is the nightly code). For example:git clone -b stable https://github.com/modular/modular.git
-
Navigate to the examples:
cd modular/examples/mojo
-
Pick an example and run it with
mojo
.If you're using a package manager other than
pixi
, make suremojo
is installed and accessible in your current shell environment. Then run some code:mojo nbody.mojo
If you installed
pixi
, there's nothing you need to do—our examples provide apixi.toml
file, which specifies package dependencies and environment settings. So you can immediately run the code and be sure you have the same version of Mojo that the code is written for. Instead of shelling into the environment, you can usepixi run
:pixi run mojo nbody.mojo
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
- uv
- pip
- conda
pixi update mojo
uv sync --upgrade-package mojo
pip install --upgrade mojo
conda update mojo
Uninstall
Mojo is installed as a Python or Conda package, so the normal package removal process applies.
- pixi
- uv
- pip
- conda
This removes the package from your local project:
pixi remove mojo
This deactivates your virtual environment:
exit
This removes the package from your local environment:
uv pip uninstall mojo && uv sync
This deactivates your virtual environment:
deactivate
This removes the package from your local environment:
pip uninstall mojo
However, this won't uninstall mojo
dependencies, so some "sub packages"
remain installed. Consider using
pip-autoremove
or switch to a
better package manager like Pixi.
This deactivates your virtual environment:
deactivate
This removes the package from your local project:
conda remove mojo
This deactivates your virtual environment:
conda deactivate
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
CLI (includes the Mojo compiler)- Mojo standard library
- Mojo language server (LSP) for IDE/editor integration
- Mojo debugger (includes LLDB)
- Mojo code formatter
- Mojo REPL
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:
mojo
CLI (includes the Mojo compiler)- Mojo standard library
System requirements
To install mojo
or mojo-compiler
, your system must meet these
specifications.
- Mac
- Linux
- Windows
- macOS Ventura (13) or later
- Apple silicon (M1/M2/M3/M4 processor)
- Python 3.9 - 3.13
- Xcode or Xcode Command Line Tools
- We currently don't support Mac GPUs
- Ubuntu 22.04 LTS
- x86-64 CPU (with SSE4.2 or newer) or AWS Graviton2/3 CPU
- Minimum 8 GiB RAM
- Python 3.9 - 3.13
- g++ or clang++ C++ compiler
- To use GPUs, see the GPU compatibility
Windows is not officially supported at this time.
In the meantime, you can try Mojo on Windows with WSL, using a compatible version of Ubuntu (see our requirements for Linux).
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 H100 and H200 (Hopper)
- NVIDIA A100 and A10 (Ampere)
- AMD Instinct MI300X and MI325X (CDNA3)
Tier 2: Confirmed compatibility
We've confirmed full compatibility with the following GPUs but we currently don't maintain tests for them:
- NVIDIA L4 and L40 (Ada Lovelace)
- NVIDIA RTX 40XX series (Ada Lovelace)
- NVIDIA RTX 30XX series (Ampere)
Tier 3: Limited compatibility
We've either confirmed or received reports that the following GPUs work for GPU programming with Mojo and can execute basic graphs with MAX APIs. However, these GPUs currently can't run some GenAI models for various reasons:
- NVIDIA Tesla P100 (Pascal)
- NVIDIA RTX 20XX series (Turing)
- NVIDIA T4 (Turing)
- NVIDIA Jetson Orin and Orin Nano (Ampere)
- NVIDIA GeForce RTX 3090 (Ampere)
- NVIDIA GeForce GTX 1080 Ti (Pascal)
- AMD Radeon 700M series (RDNA3)
- AMD Radeon RX 7000 series (RDNA3)
- AMD Radeon RX 9000 series (RDNA4)
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:
-
If you're on an NVIDIA GPU:
-
NVIDIA GPU driver version 550 or higher
- Check your NVIDIA GPU driver version using nvidia-smi
- To update, see the NVIDIA driver docs
-
-
If you're on an AMD GPU:
-
AMD GPU driver version 6.3.3 or higher
- For datacenter GPUs (MI300X/MI325X), see the Ubuntu native install guide
- For Radeon GPUs on Ubuntu, see the Linux install guide for Radeon software
- For Radeon GPUs on WSL, see the WSL install guide for Radeon software
-
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!