本文最后更新于 247 天前,如过您尝试失败,不出意外应该是出意外了。
macOS
我的配置
❯ uname -a
Darwin 42-MacBook.local 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103 arm64
❯ conda -V
conda 22.9.0
❯ git -v
git version 2.37.1 (Apple Git-137.1)
miniforge3安装
curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge-$(uname)-$(uname -m).sh
OR
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh"
bash Mambaforge-$(uname)-$(uname -m).sh
创建虚拟环境
conda create -n your_env_name python=x.x
切换到虚拟环境
conda activate your_env_name
插件安装
Python
A Visual Studio Code extension with rich support for the Python language (for all actively supported versions of the language: >=3.7), including features such as IntelliSense (Pylance), linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more!
一个Visual Studio代码扩展,具有对Python语言的丰富支持(对于该语言的所有活跃支持版本:>=3.7),包括智能感知(Pylance)、链接、调试、代码导航、代码格式化、重构、变量资源管理器、测试资源管理器等功能!
Python Indent
使你的python正确的缩进
Path Intellisense
输入文件位置的时候自动补齐文件名等信息
运行
如果需要默认运行项目中的main.py,请修改项目文件夹/.vscode/launch.json中的
"program": "${workspaceFolder}/place_to_main.py/main.py",
Windows
待续