概述
本文安装 Mojo 并使用 Mojo 创建经典的“Hello world”入门程序的过程
安装系统要求
mac系统:
Apple silicon (M1 or M2 processor)
macOS Ventura (12) or later
Python 3.9 - 3.11
Xcode or Xcode Command Line Tools
Homebrew
linux系统:
Ubuntu 20.04/22.04 LTS
x86-64 CPU (with SSE4.2 or newer) or AWS Graviton2/3 CPU
Minimum 8 GiB RAM
Python 3.9 - 3.11
g++ or clang++ C++ compiler
Windows系统:
Windows支持仍在开发中。
同时,您可以在 Windows 上通过 WSL使用 Mojo ,使用兼容版本的 Ubuntu(请参阅我们对 Linux 的要求)。
如果您已经安装了 MAX,则可以不用在单独安装,因为 MAX 包含 Mojo
注意:建议安装稳定版
安装
- 打开命令行窗口使用官方提供的脚本安装命令行工具安装,如下
curl -s https://get.modular.com | sh -
或单独手动使用命令安装,命令如下
mac系统
brew update && brew install modularml/packages/modular
Linux系统
apt-get install -y apt-transport-https &&
keyring_location=/usr/share/keyrings/mod