Python Extension
The Python extension provides first-class Pixi environment support.1
Install the Python Extension
Install from the VS Code Marketplace.
2
Automatic Detection
The extension automatically detects and selects the Pixi default environment when you open a Python file.

3
Manual Selection (if needed)
If the environment isn’t detected, open the Command Palette (Choose your Pixi environment from the list.
Ctrl+Shift+P or Cmd+Shift+P) and run:Features Available
- IntelliSense and code completion
- Debugging support
- Test discovery and execution
- Linting and formatting
- Jupyter notebook support
Direnv Extension
Direnv provides language-agnostic environment activation for VS Code.1
Install Direnv Extension
Install from the VS Code Marketplace.
2
Configure Direnv
Create a
.envrc file in your workspace root to enable automatic environment activation.3
Activate Environment
VS Code will automatically load environment variables when you open the workspace.
Devcontainer Extension
Devcontainers provide consistent development environments and work seamlessly with GitHub Codespaces.Basic Setup
1
Create .devcontainer Directory
2
Create Dockerfile
.devcontainer/Dockerfile
3
Create devcontainer.json
.devcontainer/devcontainer.json
4
Open in Devcontainer
- Click the green icon in the bottom-left corner
- Select “Reopen in Container”
- VS Code will build and start the container
The
.pixi directory is mounted as a volume to avoid case-sensitivity issues on macOS and Windows. Some conda packages contain files that differ only in case.Why Use a Volume for .pixi?
Default filesystem mounts on macOS and Windows are case-insensitive, but some conda packages (like ncurses) contain files that differ only in case. Mounting.pixi as a volume solves this issue.
Adding Secrets
For private conda channels, add authentication secrets:.devcontainer/devcontainer.json
.devcontainer/Dockerfile
- Set as environment variables when starting locally
- Configured in GitHub Codespaces Settings under “Secrets”
Tasks Integration
Run Pixi tasks directly from VS Code:tasks.json Configuration
.vscode/tasks.json
Running Tasks
- Open Command Palette:
Ctrl+Shift+P/Cmd+Shift+P - Run:
Tasks: Run Task - Select your Pixi task
Launch Configuration
Debug applications in Pixi environments:.vscode/launch.json
Workspace Settings
Optimize VS Code for Pixi workspaces:.vscode/settings.json
- Sets the default Python interpreter
- Prevents auto-activation (Pixi handles this)
- Excludes
.pixifrom file watching for performance - Excludes
.pixifrom search results - Keeps
.pixivisible in the file explorer
Multi-Environment Projects
For projects with multiple Pixi environments:.vscode/settings.json
.env files:
.env.dev
.env.prod
Tips and Tricks
Auto-activate Terminal
Pixi automatically activates environments in VS Code’s integrated terminal.
Extension Sync
Use Settings Sync to share extensions and settings across machines.
Remote Development
Use Remote-SSH extension to develop on remote machines with Pixi installed.
Multiple Workspaces
Use VS Code workspaces to manage multiple Pixi projects simultaneously.
Troubleshooting
Environment Not Detected
- Reload the window:
Developer: Reload Window - Manually select interpreter via Command Palette
- Check that
.pixi/envs/defaultexists
Slow Performance
Add.pixi to watcher exclusions in settings (see Workspace Settings above).