Skip to content

VS Code can't find Homebrew-installed CondaΒ #23162

@kxmh42

Description

@kxmh42

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

  1. On macOS 14.3.1, install Conda with brew install miniconda
  2. Open VS Code and open any ipynb file.
  3. Press Shift-Cmd-P and click on "Notebook: Select Notebook Kernel"
  4. Click "Select Another Kernel..."
  5. Click "Python Environments..."
  6. Click "+ Create Python Environment"
  7. Click "Conda"

Expected result: A menu with a choice of the version of Python to install in the environment.
Actual result: An error box in the bottom right corner, saying Install `conda` to create conda environments.

Probable root cause: the hardcoded glob patterns for searching Conda in src/test/interpreters/condaService.node.ts, which don't match /opt/homebrew/bin/conda.

Quick workaround: cd /opt && sudo ln -s homebrew conda (since /opt/conda/bin/conda is matched by the patterns).

A quick solution would be to add a pattern for Homebrew, and a better one would be to look for Conda in a way that is independent of the way it is installed.

VS Code Version

Version: 1.87.2 Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:20:57.520Z (3 wks ago) Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.3.0

Jupyter Extension Version

v2024.2.0

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable buglinuxmacosneeds PRReady to be worked onverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions