Skip to content

Commit 2993968

Browse files
committed
update error msg for uv
1 parent a45ec70 commit 2993968

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/managers/builtin/helpers.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,20 @@ export async function isUvInstalled(log?: LogOutputChannel): Promise<boolean> {
2121
}
2222
log?.info(`Running: uv --version`);
2323
const proc = spawnProcess('uv', ['--version']);
24-
proc.on('error', () => {
24+
proc.on('error', (err) => {
25+
log?.warn(
26+
`uv not found or failed to run (${err.message}). Falling back to pip. If uv is installed, ensure it is in your PATH and restart VS Code.`,
27+
);
2528
available.resolve(false);
2629
});
2730
proc.stdout?.on('data', (d) => log?.info(d.toString()));
2831
proc.on('exit', (code) => {
2932
if (code === 0) {
3033
sendTelemetryEvent(EventNames.VENV_USING_UV);
34+
} else {
35+
log?.warn(
36+
`uv --version exited with code ${code}. Falling back to pip. If uv is installed, ensure it is in your PATH and restart VS Code.`,
37+
);
3138
}
3239
available.resolve(code === 0);
3340
});

src/managers/builtin/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ async function refreshPipPackagesRaw(environment: PythonEnvironment, log?: LogOu
149149
} catch (ex) {
150150
log?.error('Error running pip list', ex);
151151
log?.info(
152-
'Package list retrieval attempted using pip, action can be done with uv if installed and setting `alwaysUseUv` is enabled.',
152+
'Package list retrieval attempted using pip. To use uv instead, ensure uv is installed and in your PATH, then restart VS Code. Also verify `python-envs.alwaysUseUv` is enabled (default: true).',
153153
);
154154
throw ex;
155155
}

0 commit comments

Comments
 (0)