Conda Code
Conda environments, workspaces, packages, and tasks for Visual Studio Code.
Conda Code adds its own conda environment and package manager to the
Python Environments extension.
It discovers regular environments across local conda installations and
integrates conda-workspaces
workspace environments and tasks in the same provider.

Run Conda Code: Create Environment from File from environment.yml. The
resulting regular named environment appears as the selected project environment
in the shared Python Environments UI. Python Environments supplies the VS Code
views. Conda Code supplies the Conda Code manager and performs conda
discovery, creation, activation, package changes, and removal.
Get started
Install
Conda Code from the Visual Studio Marketplace
or run:
code --install-extension jezdez.conda-code
Python Environments is installed as an extension dependency.
Make Conda Code the default conda manager in your user or workspace
settings:
{
"python-envs.defaultEnvManager": "jezdez.conda-code:conda",
"python-envs.defaultPackageManager": "jezdez.conda-code:conda"
}
Open the Python Environments view and choose Conda Code.
Note: Python Environments currently registers its built-in conda provider
unconditionally and does not deduplicate environments across providers. Both
conda branches can appear. The settings above select Conda Code for creation
and package operations.
Follow the quickstart to
check regular environment and workspace discovery.
What Conda Code handles
- Regular environments: Find base, named, and prefix environments without
starting their Python interpreters, including environments without Python.
- Creation inputs: Create named environments from package specifications,
environment.yml, CEP 23 explicit
files, and conda-lockfiles.
- conda-workspaces: Discover, install, activate, and manage workspace
environments, create, import, and remove environment declarations, then run
declared tasks from the manifest editor through native VS Code Tasks. Shell
activation targets the exact installed workspace prefix. Conda Code uses
complete workspace snapshots and dependency declaration locations when
conda-workspaces reports them.
- Owner-aware operations: Route activation, package changes, and safe
deletion through the conda installation that owns each prefix. Run Conda
Code: Export Environment SBOM for an installed prefix, or Conda Code:
Export Workspace Lockfile SBOM for a declared environment that may not be
installed.
- Ecosystem compatibility: Include
conda-pypi package records, ignore
conda-global tool prefixes
and conda-exec cache prefixes,
and leave Pixi workspaces to
Pixi Code
when it is installed.
Run Conda Code: Refresh Environments after an external change that is not
picked up automatically.
Requirements
Required:
- Visual Studio Code 1.118 or newer
- conda 26.3 or newer
- A trusted VS Code window for project operations
- A local folder registered as a Python project for project-scoped
creation and workspace discovery
Optional integrations:
- conda-workspaces 0.7 or newer for workspace environments and tasks
- conda-lockfiles 0.2 or newer for conda lockfile creation inputs
- conda 26.5 or newer for workspace PyPI dependencies
- conda-sboms 0.3.0 or newer
for selected-environment CycloneDX export
Newer conda-workspaces capabilities are detected at runtime. The 0.7 integration
remains available when complete snapshots or dependency declaration locations
are not reported.
Set conda-code.condaExecutable when the primary conda is not available through
CONDA_EXE, the Python extension's python.condaPath setting, or PATH.
See the
complete requirements
for installation details.
Learn more
Report problems and request features in the
issue tracker.
Development
Use the Node.js release pinned in .nvmrc.
npm ci
npm run typecheck
npm test
npm run docs
Run the Extension launch configuration in an Extension Development Host.
Build an installable package with npm run vsix.
npm run test:coverage reports coverage for loaded production modules, excluding
test helpers. Modules not loaded by unit tests, including extension activation,
are not included in the percentages.
The opt-in dist/integration/smoke.js test runs inside VS Code, not Node's test
runner. After compiling, set CONDA_CODE_TEST_PREFIX to an existing runnable conda
environment and launch VS Code with --extensionDevelopmentPath pointing here
and --extensionTestsPath pointing to that compiled file. Use a disposable
workspace, a separate --user-data-dir, and a separate --extensions-dir with
the Python, Python Environments, and Python Debugger extensions installed. Set
python-envs.terminal.autoActivationType to command, enable
python-envs.packageWatchers, and set conda-code.condaExecutable to a working
conda installation in that isolated profile.
Set terminal.integrated.inheritEnv explicitly to true in the isolated profile
to suppress Python's conda environment-inheritance suggestion without changing
the default behavior. Do not change normal user settings for this test.
The test verifies activation, discovery, selection, package listing, background
execution, terminal activation, and debug interpreter selection. A metadata-only
prefix inside its scratch directory tests external package-change events without
installing or removing packages in the supplied environment. The test restores
the previous selection and removes its scratch files.
For example, run this from the repository root on macOS after adjusting the two
conda paths. The prefix must already be discoverable by Conda Code; the environment
variable does not register it. This creates a separate profile and installs the
Python extensions there. Keep the temporary directory until you have inspected
any failure logs.
export CONDA_CODE_TEST_PREFIX="$HOME/miniforge3"
export CONDA_CODE_TEST_CONDA="$HOME/miniforge3/bin/conda"
export CONDA_CODE_TEST_ROOT="$(mktemp -d)"
mkdir -p "$CONDA_CODE_TEST_ROOT/user/User" "$CONDA_CODE_TEST_ROOT/workspace"
node -e 'require("node:fs").writeFileSync(process.env.CONDA_CODE_TEST_ROOT + "/user/User/settings.json", JSON.stringify({
"security.workspace.trust.enabled": false,
"telemetry.telemetryLevel": "off",
"python.useEnvironmentsExtension": true,
"python-envs.defaultEnvManager": "jezdez.conda-code:conda",
"python-envs.defaultPackageManager": "jezdez.conda-code:conda",
"python-envs.terminal.autoActivationType": "command",
"python-envs.packageWatchers": true,
"terminal.integrated.inheritEnv": true,
"conda-code.condaExecutable": process.env.CONDA_CODE_TEST_CONDA,
"extensions.autoUpdate": false,
"update.mode": "none"
}, null, 2))'
code --user-data-dir="$CONDA_CODE_TEST_ROOT/user" \
--extensions-dir="$CONDA_CODE_TEST_ROOT/extensions" \
--install-extension ms-python.python \
--install-extension ms-python.vscode-python-envs \
--install-extension ms-python.debugpy
npm run compile
env -u ELECTRON_RUN_AS_NODE "/Applications/Visual Studio Code.app/Contents/MacOS/Code" \
--user-data-dir="$CONDA_CODE_TEST_ROOT/user" \
--extensions-dir="$CONDA_CODE_TEST_ROOT/extensions" \
--extensionDevelopmentPath="$PWD" \
--extensionTestsPath="$PWD/dist/integration/smoke.js" \
--skip-welcome --skip-release-notes "$CONDA_CODE_TEST_ROOT/workspace"
License
Conda Code is distributed under the
BSD 3-Clause License.