IDE
# 1 PyCharm Professional
JetBrains 出品必属精品,DDDD。

根据上图创建的项目,本质上是创建了一个虚拟环境,在创建后的项目根目录下存在 .venv 文件夹。
# 2 VS Code
Python in Visual Studio Code (opens new window)
插件:
# 3 JupyterLab
Project Jupyter | Home (opens new window)
- 一个可以分部操作的、网页的 IDE
- 非常适合随时随地开发
关于 JupyterLab 与 Jupyter Notebook
可理解 JupyterLab 是 Jupyter Notebook 的封装版本,功能更丰富
# 3.1 安装
# 3.1.1 常规
# 安装
pip install jupyterlab
# 启动
jupyter lab
jupyter lab --ip 0.0.0.0
# zsh提示找不到命令问题
> pip3 show jupyterlab | grep Location
Location: /home/ubuntu/.local/lib/python3.10/site-packages
> export PATH=/home/ubuntu/.local/lib/python3.10/site-packages:$PATH
# 3.1.2 helm
- jupyterhub 4.0.1-0.dev.git.6864.hfc323db4 · jupyterhub/jupyterhub (opens new window)
- Zero to JupyterHub with Kubernetes — Zero to JupyterHub with Kubernetes documentation (opens new window)
helm repo add jupyterhub https://hub.jupyter.org/helm-chart/
helm install my-jupyterhub jupyterhub/jupyterhub --version 4.0.0
# 3.2 操作
- 操作与其他 IDE 类似,主要是创建
Notebook类型文件。 - 格子 (Cell) 默认为
Code,上方状态栏可更改为markdown来编写文档 Edit - Clear Cell Output:清除当前格子的输出内容Edit - Clear Outputs of All Cells:清除所有格子的输出内容
# 3.3 快捷键
| Win | 含义 |
|---|---|
| Shift + Enter | 运行当前格代码 |
# 3.4 扩展
# 3.4.1 格式化代码
JupyterLab Code Formatter (opens new window)
pip install jupyterlab-code-formatter
pip install black isort
- 重启启动 jupyter lab
- 在顶部即会出现格式化按钮
上次更新: 2026/11/01, 18:53:41