操作步驟 (Windows 10/11)
- 按 `Win + S` 搜尋 **"編輯系統環境變數"** → 開啟「系統屬性」→「進階」→「環境變數」。
- **「系統變數」** 區域找到 `Path` → 雙擊編輯 → 「新增」 → 輸入 Python 安裝路徑 (如 `C:\Python39`)。
- 再新增 `Scripts` 路徑 (如 `C:\Python39\Scripts`),確保 `pip` 可用。
- 點擊「確定」關閉所有對話框。
- **重新開啟 CMD/PowerShell**,輸入 `python --version` 驗證。
安裝時自動勾選
Python 3.3+ 安裝程式提供 **"Add Python to PATH"** 核取方塊,**安裝時勾選即可自動完成**,無需手動設定。
驗證
> python --version
Python 3.9.7
> pip --version
pip 21.2.4 from C:\Python39\lib\site-packages\pip (python 3.9)