周末把 Macbook Air 帶回鄉下, 完成 Xcode 命令列工具 + Homebrew + uv + Python 3.14 的安裝, 昨天回到高雄, 按照同樣流程於 Mac mini 上依序安裝, 本篇旨在紀錄安裝過程, 參考 :
指令如下 :
xcode-select --install
tony1966@TonydeMac-mini ~ % xcode-select --install
xcode-select: note: install requested for command line developer tools
tony1966@TonydeMac-mini ~ % xcode-select -p
/Library/Developer/CommandLineTools
tony1966@TonydeMac-mini ~ % git --version
git version 2.54.0 (Apple Git-157)
2. 安裝 Homebrew :
指令如下 :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
tony1966@TonydeMac-mini ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
Password:
==> 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
/etc/paths.d/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
Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/bin/install -d -o tony1966 -g admin -m 0755 /opt/homebrew
==> Found Git: /Library/Developer/CommandLineTools/usr/bin/git
==> Downloading and installing Homebrew...
remote: Enumerating objects: 374274, done.
remote: Counting objects: 100% (661/661), done.
remote: Compressing objects: 100% (273/273), done.
remote: Total 374274 (delta 468), reused 472 (delta 385), pack-reused 373613 (from 2)
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (33/33), done.
remote: Total 55 (delta 33), reused 33 (delta 33), pack-reused 22 (from 1)
==> /usr/bin/sudo /usr/bin/install -o root -g wheel -m 0644 /var/folders/zz/39gpk0ss34z697n36th218k00000gn/T/tmp.iQeRnolumI /etc/paths.d/homebrew
HOMEBREW_BREW_GIT_REMOTE set: using https://github.com/Homebrew/brew as the Homebrew/brew Git remote.
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
==> Updating Homebrew...
==> Downloading https://ghcr.io/v2/homebrew/core/portable-ruby/blobs/sha256:43ff285a82f48c84a06d0676a3800815a19d290d32e44182ddd7a6e95478e18e
################################################################################################################# 100.0%
==> Pouring portable-ruby-4.0.9.arm64_big_sur.bottle.tar.gz
==> 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 commands in your terminal to add Homebrew to your PATH:
echo >> /Users/tony1966/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> /Users/tony1966/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"
- Run brew help to get started
- Further documentation:
https://docs.brew.sh
tony1966@TonydeMac-mini ~ % echo >> ~/.zprofile
tony1966@TonydeMac-mini ~ % echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
tony1966@TonydeMac-mini ~ % eval "$(/opt/homebrew/bin/brew shellenv)"
tony1966@TonydeMac-mini ~ % brew --version
Homebrew 7.0.13
tony1966@TonydeMac-mini ~ % brew --prefix
/opt/homebrew
tony1966@TonydeMac-mini ~ % which brew
/opt/homebrew/bin/brew
tony1966@TonydeMac-mini ~ % brew install uv
==> Downloading bottle manifests
✔︎ Bottle Manifest uv (0.13.8) Downloaded 16.9KB/ 16.9KB
==> Fetching downloads for: uv
✔︎ Bottle uv (0.13.8) Downloaded 15.3MB/ 15.3MB
==> Pouring uv--0.13.8.arm64_golden_gate.bottle.tar.gz
🍺 /opt/homebrew/Cellar/uv/0.13.8: 17 files, 34MB
==> Caveats
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
tony1966@TonydeMac-mini ~ % uv --version
uv 0.13.8 (Homebrew 2026-11-12 aarch64-apple-darwin)
3. 安裝 Python 3.14 :
指令如下 :
uv python install 3.14 --default
安裝前先檢查 python 與 python3 指令 :
tony1966@TonydeMac-mini ~ % python3
Python 3.9.6 (default, Oct 19 2026, 19:18:13)
[Clang 21.0.0 (clang-2100.4.1.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
tony1966@TonydeMac-mini ~ % python
zsh: command not found: python
tony1966@TonydeMac-mini ~ % uv python list 3.14
cpython-3.14.10-macos-aarch64-none <download available>
tony1966@TonydeMac-mini ~ % uv python install 3.14 --default
warning: The `--default` option is experimental and may change without warning. Pass `--preview-features python-install-default` to disable this warning
Installed Python 3.14.10 in 2.18s
+ cpython-3.14.10-macos-aarch64-none (python, python3, python3.14)
warning: `/Users/tony1966/.local/bin` is not on your PATH. To use installed Python executables, run `export PATH="/Users/tony1966/.local/bin:$PATH"` or `uv python update-shell`.
tony1966@TonydeMac-mini ~ % python
zsh: command not found: python
tony1966@TonydeMac-mini ~ % uv python update-shell
Created configuration file: /Users/tony1966/.zshenv
Restart your shell to apply changes
tony1966@TonydeMac-mini ~ %
關閉 terminal 重開 :
tony1966@TonydeMac-mini ~ % python
Python 3.14.10 (main, Nov 11 2026, 00:14:32) [Clang 23.1.3 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
tony1966@TonydeMac-mini ~ %
如此一來我的 Macbook Air 與 Mac mini 的環境就完全相同了.
沒有留言 :
張貼留言