Visual Studio Code
This guide explains how to set up Visual Studio Code (VS Code) for working with Ribasim Python. This page is not specific to Ribasim Python but aims to help users get started. This guide assumes you have already installed Ribasim Python in a uv or Pixi environment as described in the installation guide. See also the VS Code docs for Python.
1 Recommended extensions
Install the following VS Code extensions for the best experience:
- Python - Essential Python language support
- Python Environments - Enhanced environment management
The Python Environments extension provides out-of-the-box support for venv environments, which is the environment type that uv creates.
2 Install packages for notebooks
VS Code requires ipykernel and pip to run Jupyter notebooks. Add these packages based on your package manager:
uv add ipykernel pippixi add ipykernel pip3 Environment setup
uv creates a standard .venv virtual environment in your project folder. This environment type is supported out of the box by VS Code with the Python Environments extension.
VS Code should automatically detect the .venv environment. If not, select it manually:
- Open your project folder in VS Code
- Open the Command Palette (Ctrl-Shift-PCtrl-Shift-P or Cmd-Shift-PCmd-Shift-P on macOS)
- Type “Python: Select Interpreter”
- Select the Python executable from your
.venvfolder (.venv/Scripts/python.exeon Windows,.venv/bin/pythonon Linux/macOS)
For Pixi environments, we recommend installing the Pixi extension. This helps the Python Environments extension detect Pixi environments.
VS Code should automatically detect the Pixi environment with these extensions installed. If not, select it manually:
- Open your project folder in VS Code
- Open the Command Palette (Ctrl-Shift-PCtrl-Shift-P or Cmd-Shift-PCmd-Shift-P on macOS)
- Type “Python: Select Interpreter”
- Select the Python executable from your Pixi environment (
.pixi/envs/default/python.exeon Windows,.pixi/envs/default/bin/pythonon Linux/macOS)