databricks-vscode icon indicating copy to clipboard operation
databricks-vscode copied to clipboard

[BUG] Extension fails checking env dependencies when using `uv` as package/project management tool rather than pip

Open bthorsted opened this issue 10 months ago • 3 comments

Describe the bug When a virtual environment is initialized using uv, pip will not be added to the venv since it is not needed for package management when I already have uv. However, the Databricks extension assumes pip is available and thus fails when checking dependencies. The precise error message is as follows:

Failed to check python environment dependencies:
"Command failed:
    cmd.exe /d /c ""c:\[path\to\my-project]\.venv\Scripts\python.exe" "-m" "pip" "list"
    "--format" "json" "--disable-pip-version-check"
    "--no-python-version-warning""
c:\[path\to\my-project]\.venv\Scripts\python.exe: No module named pip ".

To Reproduce Steps to reproduce the behavior:

  1. Install uv
  2. In a databricks project directory, run uv venv
  3. Open Vscode
  4. See error

System information:

Version: 1.99.0 (user setup) Commit: 4437686ffebaf200fa4a6e6e67f735f3edf24ada Date: 2025-04-02T21:35:19.530Z Electron: 34.3.2 ElectronBuildId: 11161073 Chromium: 132.0.6834.210 Node.js: 20.18.3 V8: 13.2.152.41-electron.0 OS: Windows_NT x64 10.0.22631

Databricks Version: 2.9.2

Databricks Extension Logs Databricks Logs.log

bthorsted avatar Apr 08 '25 09:04 bthorsted

is there a workaround to still use uv and databricks connect as we wait for the PR?

FedericoRaimondi avatar May 07 '25 09:05 FedericoRaimondi

One workaround is to call uv venv --seed in your already existing venv (docs). It will install pip into the venv, which will make our internal calls to pip work.

ilia-db avatar May 08 '25 08:05 ilia-db

thanks! much appreciated 👍🏻

FedericoRaimondi avatar May 08 '25 09:05 FedericoRaimondi

Released 2.10.1 with the uv support. We only use uv if the command is accessible from the vscode (so, on the PATH), and if the project has the uv.lock in the root

ilia-db avatar Jun 23 '25 13:06 ilia-db