MacOS系统安装Homebrew环境教程
Homebrew是macOS系统上的包管理器,它可以方便地安装和管理各种开发工具和应用程序。当你在macOS上安装Homebrew时,它会自动安装以下组件和依赖项:
- Command Line Tools: Homebrew会自动安装Xcode Command Line Tools,包括编译器和其他开发工具,这些工具是进行软件开发所必需的。
- Homebrew核心程序:Homebrew会安装Homebrew自身的核心程序,用于管理软件包和依赖项的安装和更新。
- Git:Homebrew会安装Git版本控制工具,Git是一个广泛使用的代码版本管理系统。
- Ruby:Homebrew本身是用Ruby编写的,因此会自动安装Ruby运行时环境。
- curl和wget:Homebrew会安装用于网络传输的工具curl和wget,它们用于从网络下载软件包和文件。
- Perl和Python:Homebrew可能会安装Perl和Python这两种脚本语言,因为一些软件可能需要使用它们。
除了上述主要组件,Homebrew还可能会安装一些其他辅助工具和依赖项,以确保各种软件包的正常安装和运行。
前言
关于AI的项目环境部署,其实还是Windows系统比较主流,但是有些环境也是可以MacOS部署的。所以站长单独出一期关于MacOS系统安装开源项目基础环境的教程吧。
正好站长在2020年苹果M1芯片刚出来的时候买了一台MacBook Air,默认是8GB内存,站长咬牙一跺脚,又加购了8G内存,当前系统版本为12.2.1。
如果您是非M系列芯片,安装过程应该也是一致的,本站没有非M系列芯片的设备,所以未到测试。
失败示例
我知道你急,但是你先别急,建议跳过此步骤。
正常来说,我们应该先通过安装包管理器Homebrew
,Homebrew可以帮你轻松下载所有MacOS系统中所缺失的依赖包。
下载地址:macOS(或 Linux)缺失的软件包的管理器 — Homebrew
打开网页之后,鼠标点击站长已经图像中标记的红色区域即可自动复制安装所用到的命令行内容。
自动复制的内容如下:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
此时我们运行启动台
→其它
→终端
打开终端的黑色窗口之后,我们粘贴刚刚所复制的内容,然后按下回车。
你大概率将会得到如下报错信息:
curl: (7) Failed to connect to raw.githubusercontent.com port 443 after 21 ms: Couldn't connect to server
站长这里已经配置过了魔法环境,还是无法下载,所以就不建议大家尝试了。
安装教程
下面进入正文,如何正确的安装部署Homebrew环境。
我们直接使用CDN加速方式下载Homebrew
,执行以下代码,从 jsdelivr.net 获取Homebrew
安装脚本。
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install/install.sh)"
此时我们将会得到如下提示内容,此时需要我们输入你的MacOS系统用户密码,输入之后按下回车即可。
⚠️注意:输入密码时不会被显示出来,就像没有输入任何内容一样,这是系统安全的保护机制,不用理会,正常输入,然后放心大胆的按下回车即可。
==> Checking for `sudo` access (which may request your password)... Password:
此时你将会看到如下提示内容,提醒你将要安装Xcode
命令行工具,我们直接按下回车
键。
==> This script will install: /opt/homebrew/bin/brew /opt/homebrew/share/doc/homebrew /opt/homebrew/share/man/man1/brew.1 /opt/homebrew/share/zsh/site-functions/_brew /opt/homebrew/etc/bash_completion.d/brew /opt/homebrew ==> The following new directories will be created: /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> The Xcode Command Line Tools will be installed. Press RETURN/ENTER to continue or any other key to abort:
按下回车后,我们将会等待片刻,具体的安装日志内容如下:
Press RETURN/ENTER to continue or any other key to abort: ==> /usr/bin/sudo /usr/bin/install -d -o root -g wheel -m 0755 /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod ug=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod go-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions ==> /usr/bin/sudo /usr/sbin/chown yufeng /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/sbin/chown -R yufeng:admin /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /Users/yufeng/Library/Caches/Homebrew ==> /usr/bin/sudo /bin/chmod g+rwx /Users/yufeng/Library/Caches/Homebrew ==> /usr/bin/sudo /usr/sbin/chown -R yufeng /Users/yufeng/Library/Caches/Homebrew ==> Searching online for the Command Line Tools ==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress ==> Installing Command Line Tools for Xcode-14.3 ==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ for\ Xcode-14.3 Software Update Tool Finding available software Downloading Command Line Tools for Xcode Downloaded Command Line Tools for Xcode Installing Command Line Tools for Xcode Done with Command Line Tools for Xcode Done. ==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools ==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress ==> Downloading and installing Homebrew... --------------------------------------------------------- 此部分内容过长,省略不重要的部分。 --------------------------------------------------------- * [new tag] 4.0.9 -> 4.0.9 HEAD is now at fec24f5c0 Merge pull request #15352 from woodruffw-forks/ww/step-summary-var Warning: /opt/homebrew/bin is not in your PATH. Instructions on how to configure your shell for Homebrew can be found in the 'Next steps' section below. ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics data has been sent yet (nor will any be during this install run). ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run these two commands in your terminal to add Homebrew to your PATH: (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/yufeng/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" - Run brew help to get started - Further documentation: https://docs.brew.sh yufeng@LYF_MacBook ~ %
- ⚠️注意1
- 这里有一处非常重要!那就是需要少加环境变量,我们看倒数第7行和第6行,这就是我们需要执行的内容,我们将这两条复制一下,单独执行。
- ⚠️注意2
- 以下两行内容,分开执行,而且不要复制本站的!一定要复制你自己的倒数第7行和第6行内容!因为每个人的MacOS系统用户名不一样,复制本站的没有用,不要偷懒。
- ⚠️注意3
- 一定要先执行倒数第7行,然后再执行倒数第6行,不要搞错顺序。
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/yufeng/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
此时我们执行如下命令,尝试启动brew
。
brew help
如果你安装成功了,那么将会得到如下内容提示:
yufeng@LYF_MacBook ~ % brew help Example usage: brew search TEXT|/REGEX/ brew info [FORMULA|CASK...] brew install FORMULA|CASK... brew update brew upgrade [FORMULA|CASK...] brew uninstall FORMULA|CASK... brew list [FORMULA|CASK...] Troubleshooting: brew config brew doctor brew install --verbose --debug FORMULA|CASK Contributing: brew create URL [--no-fetch] brew edit [FORMULA|CASK...] Further help: brew commands brew help [COMMAND] man brew https://docs.brew.sh
常用工具安装
在终端(Terminal)中执行如下命令,安装一些常用的软件包和工具。
brew install cmake protobuf rust python@3.10 git wget
终端会开始执行命令,并显示安装进度。这些命令将安装以下软件包和工具:
- cmake:用于编译和构建软件的工具;
- protobuf:Google Protocol Buffers,一种高效的序列化数据格式;
- rust:一种系统级编程语言,用于开发高性能和安全的软件;
- python@3.10:Python 3.10 版本;
- git:版本控制系统,用于协作开发和管理代码;
- wget:用于从 Web 上下载文件的工具。
安装日志
yufeng@LYF_MacBook ~ % brew install cmake protobuf rust python@3.10 git wget Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake ==> Fetching cmake ==> Downloading https://ghcr.io/v2/homebrew/core/cmake/manifests/3.26.3 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/cmake/blobs/sha256:9a01063acf50 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching protobuf ==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/manifests/21.12-2 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/blobs/sha256:09fdc2fcc ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for rust: ca-certificates, openssl@3 and pkg-config ==> Fetching ca-certificates ==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2023- ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/blobs/sha256:11 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching openssl@3 ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.1.0 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:1dd3c96c ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching pkg-config ==> Downloading https://ghcr.io/v2/homebrew/core/pkg-config/manifests/0.29.2_3 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/pkg-config/blobs/sha256:3ff612c ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching rust ==> Downloading https://ghcr.io/v2/homebrew/core/rust/manifests/1.69.0 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/rust/blobs/sha256:0ca792a1dc621 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for python@3.10: gdbm, mpdecimal, openssl@1.1, readline, sqlite and xz ==> Fetching gdbm ==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/manifests/1.23 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/gdbm/blobs/sha256:a7321472cc9ff ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching mpdecimal ==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/manifests/2.5.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/mpdecimal/blobs/sha256:5b1c62c0 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching openssl@1.1 ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/manifests/1.1.1t ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/openssl/1.1/blobs/sha256:e1e08d ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching readline ==> Downloading https://ghcr.io/v2/homebrew/core/readline/manifests/8.2.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/readline/blobs/sha256:fba42a9bd ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching sqlite ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/manifests/3.41.2 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/sqlite/blobs/sha256:2a77f2ddcf1 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching xz ==> Downloading https://ghcr.io/v2/homebrew/core/xz/manifests/5.4.2 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/xz/blobs/sha256:5919a39bb56458a ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching python@3.10 ==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/manifests/3.10.11 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/python/3.10/blobs/sha256:7821f3 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for git: gettext and pcre2 ==> Fetching gettext ==> Downloading https://ghcr.io/v2/homebrew/core/gettext/manifests/0.21.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/gettext/blobs/sha256:28c5b06e66 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching pcre2 ==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/manifests/10.42 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/pcre2/blobs/sha256:8423a338c590 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching git ==> Downloading https://ghcr.io/v2/homebrew/core/git/manifests/2.40.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/git/blobs/sha256:df2e65dfd20e76 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching dependencies for wget: libunistring and libidn2 ==> Fetching libunistring ==> Downloading https://ghcr.io/v2/homebrew/core/libunistring/manifests/1.1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/libunistring/blobs/sha256:c78e7 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching libidn2 ==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/manifests/2.3.4_1-1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/libidn2/blobs/sha256:b044c66cc0 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Fetching wget ==> Downloading https://ghcr.io/v2/homebrew/core/wget/manifests/1.21.3_1-1 ######################################################################### 100.0% ==> Downloading https://ghcr.io/v2/homebrew/core/wget/blobs/sha256:7415a3b847237 ==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh ######################################################################### 100.0% ==> Pouring cmake--3.26.3.arm64_ventura.bottle.tar.gz ==> Caveats To install the CMake documentation, run: brew install cmake-docs Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/cmake ==> Summary 🍺 /opt/homebrew/Cellar/cmake/3.26.3: 3,188 files, 46.4MB ==> Running `brew cleanup cmake`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> Pouring protobuf--21.12.arm64_ventura.bottle.2.tar.gz ==> Caveats Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/protobuf ==> Summary 🍺 /opt/homebrew/Cellar/protobuf/21.12: 288 files, 19.2MB ==> Running `brew cleanup protobuf`... ==> Installing dependencies for rust: ca-certificates, openssl@3 and pkg-config ==> Installing rust dependency: ca-certificates ==> Pouring ca-certificates--2023-01-10.all.bottle.tar.gz ==> Regenerating CA certificate bundle from keychain, this may take a while... 🍺 /opt/homebrew/Cellar/ca-certificates/2023-01-10: 3 files, 216.9KB ==> Installing rust dependency: openssl@3 ==> Pouring openssl@3--3.1.0.arm64_ventura.bottle.tar.gz ==> Downloading https://formulae.brew.sh/api/formula.jws.json -#O=# # # 🍺 /opt/homebrew/Cellar/openssl@3/3.1.0: 6,494 files, 28.4MB ==> Installing rust dependency: pkg-config ==> Pouring pkg-config--0.29.2_3.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/pkg-config/0.29.2_3: 11 files, 676.2KB ==> Installing rust ==> Pouring rust--1.69.0.arm64_ventura.bottle.tar.gz ==> Caveats zsh completions have been installed to: /opt/homebrew/share/zsh/site-functions ==> Summary 🍺 /opt/homebrew/Cellar/rust/1.69.0: 36,769 files, 878MB ==> Running `brew cleanup rust`... ==> Installing dependencies for python@3.10: gdbm, mpdecimal, openssl@1.1, readline, sqlite and xz ==> Installing python@3.10 dependency: gdbm ==> Pouring gdbm--1.23.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/gdbm/1.23: 24 files, 1MB ==> Installing python@3.10 dependency: mpdecimal ==> Pouring mpdecimal--2.5.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/mpdecimal/2.5.1: 71 files, 2.2MB ==> Installing python@3.10 dependency: openssl@1.1 ==> Pouring openssl@1.1--1.1.1t.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/openssl@1.1/1.1.1t: 8,101 files, 18MB ==> Installing python@3.10 dependency: readline ==> Pouring readline--8.2.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/readline/8.2.1: 50 files, 1.7MB ==> Installing python@3.10 dependency: sqlite ==> Pouring sqlite--3.41.2.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/sqlite/3.41.2: 11 files, 4.5MB ==> Installing python@3.10 dependency: xz ==> Pouring xz--5.4.2.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/xz/5.4.2: 162 files, 2.5MB ==> Installing python@3.10 ==> Pouring python@3.10--3.10.11.arm64_ventura.bottle.tar.gz ==> /opt/homebrew/Cellar/python@3.10/3.10.11/bin/python3.10 -m ensurepip ==> /opt/homebrew/Cellar/python@3.10/3.10.11/bin/python3.10 -m pip install -v --no-deps --no-index --upgrade --isolated --target=/opt/homebrew/lib/python3.10/site-packages /opt/homebrew/Cellar/python@3.10 ==> Caveats Python has been installed as /opt/homebrew/bin/python3.10 Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to `python3.10`, `python3.10-config`, `pip3.10` etc., respectively, have been installed into /opt/homebrew/opt/python@3.10/libexec/bin You can install Python packages with pip3.10 install <package> They will install into the site-package directory /opt/homebrew/lib/python3.10/site-packages tkinter is no longer included with this formula, but it is available separately: brew install python-tk@3.10 If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: brew install python3 See: https://docs.brew.sh/Homebrew-and-Python ==> Summary 🍺 /opt/homebrew/Cellar/python@3.10/3.10.11: 3,099 files, 57.2MB ==> Running `brew cleanup python@3.10`... ==> Installing dependencies for git: gettext and pcre2 ==> Installing git dependency: gettext ==> Pouring gettext--0.21.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/gettext/0.21.1: 1,983 files, 20.9MB ==> Installing git dependency: pcre2 ==> Pouring pcre2--10.42.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/pcre2/10.42: 230 files, 6.2MB ==> Installing git ==> Pouring git--2.40.1.arm64_ventura.bottle.tar.gz ==> Caveats The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula. Subversion interoperability (git-svn) is now in the `git-svn` formula. zsh completions and functions have been installed to: /opt/homebrew/share/zsh/site-functions ==> Summary 🍺 /opt/homebrew/Cellar/git/2.40.1: 1,635 files, 48.9MB ==> Running `brew cleanup git`... ==> Installing dependencies for wget: libunistring and libidn2 ==> Installing wget dependency: libunistring ==> Pouring libunistring--1.1.arm64_ventura.bottle.tar.gz 🍺 /opt/homebrew/Cellar/libunistring/1.1: 56 files, 5.0MB ==> Installing wget dependency: libidn2 ==> Pouring libidn2--2.3.4_1.arm64_ventura.bottle.1.tar.gz 🍺 /opt/homebrew/Cellar/libidn2/2.3.4_1: 79 files, 1MB ==> Installing wget ==> Pouring wget--1.21.3_1.arm64_ventura.bottle.1.tar.gz 🍺 /opt/homebrew/Cellar/wget/1.21.3_1: 89 files, 4.2MB ==> Running `brew cleanup wget`... ==> Caveats ==> cmake To install the CMake documentation, run: brew install cmake-docs Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/cmake ==> protobuf Emacs Lisp files have been installed to: /opt/homebrew/share/emacs/site-lisp/protobuf ==> rust zsh completions have been installed to: /opt/homebrew/share/zsh/site-functions ==> python@3.10 Python has been installed as /opt/homebrew/bin/python3.10 Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to `python3.10`, `python3.10-config`, `pip3.10` etc., respectively, have been installed into /opt/homebrew/opt/python@3.10/libexec/bin You can install Python packages with pip3.10 install <package> They will install into the site-package directory /opt/homebrew/lib/python3.10/site-packages tkinter is no longer included with this formula, but it is available separately: brew install python-tk@3.10 If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: brew install python3 See: https://docs.brew.sh/Homebrew-and-Python ==> git The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula. Subversion interoperability (git-svn) is now in the `git-svn` formula. zsh completions and functions have been installed to: /opt/homebrew/share/zsh/site-functions yufeng@LYF_MacBook ~ %
至此,我们就已经完成啦,整体来说,还是挺简单的。
最后,我们来验证一下是否已经安装成功。在终端执行如下代码,查看返回内容。
brew
如果你正确的安装了该环境,那么将会看到如下输出。
yufeng@LYF_MacBook % brew Example usage: brew search TEXT|/REGEX/ brew info [FORMULA|CASK...] brew install FORMULA|CASK... brew update brew upgrade [FORMULA|CASK...] brew uninstall FORMULA|CASK... brew list [FORMULA|CASK...] Troubleshooting: brew config brew doctor brew install --verbose --debug FORMULA|CASK Contributing: brew create URL [--no-fetch] brew edit [FORMULA|CASK...] Further help: brew commands brew help [COMMAND] man brew https://docs.brew.sh
如果你得到的输出内容与本站不一致,请尝试重新安装。
评论 (0)