【Python】VSCode 设定打开自动激活的(虚拟)环境
自動激活環境
如果希望 VS Code 自動使用 daily 環境,無需每次手動選擇,可以設置工作區設置:
1. 打開 VS Code 的工作區設置:
按 Ctrl+,
打開設置界面。
搜索 python.defaultInterpreterPath
。
- 設置為 daily 環境的 Python 路徑:
在 python.defaultInterpreterPath 中輸入:
"python.defaultInterpreterPath": "D:\\你的环境路径\\python.exe"
保存設置,重新打開 VS Code,確認環境已自動切換。