@@ -5,7 +5,7 @@ import { l10n, LogOutputChannel, ProgressLocation, QuickPickItem, QuickPickItemK
55import { EnvironmentManager , PythonEnvironment , PythonEnvironmentApi , PythonEnvironmentInfo } from '../../api' ;
66import { ENVS_EXTENSION_ID } from '../../common/constants' ;
77import { Common , VenvManagerStrings } from '../../common/localize' ;
8- import { traceInfo } from '../../common/logging' ;
8+ import { traceInfo , traceVerbose } from '../../common/logging' ;
99import { getWorkspacePersistentState } from '../../common/persistentState' ;
1010import { EventNames } from '../../common/telemetry/constants' ;
1111import { sendTelemetryEvent } from '../../common/telemetry/sender' ;
@@ -581,15 +581,19 @@ export async function resolveVenvPythonEnvironmentPath(
581581 manager : EnvironmentManager ,
582582 baseManager : EnvironmentManager ,
583583) : Promise < PythonEnvironment | undefined > {
584- const resolved = await nativeFinder . resolve ( fsPath ) ;
585-
586- if (
587- resolved . kind === NativePythonEnvironmentKind . venv ||
588- resolved . kind === NativePythonEnvironmentKind . venvUv ||
589- resolved . kind === NativePythonEnvironmentKind . uvWorkspace
590- ) {
591- const envInfo = await getPythonInfo ( resolved ) ;
592- return api . createPythonEnvironmentItem ( envInfo , manager ) ;
584+ try {
585+ const resolved = await nativeFinder . resolve ( fsPath ) ;
586+
587+ if (
588+ resolved . kind === NativePythonEnvironmentKind . venv ||
589+ resolved . kind === NativePythonEnvironmentKind . venvUv ||
590+ resolved . kind === NativePythonEnvironmentKind . uvWorkspace
591+ ) {
592+ const envInfo = await getPythonInfo ( resolved ) ;
593+ return api . createPythonEnvironmentItem ( envInfo , manager ) ;
594+ }
595+ } catch ( ex ) {
596+ traceVerbose ( `Failed to resolve venv env "${ fsPath } ": ${ ex } ` ) ;
593597 }
594598
595599 return resolveSystemPythonEnvironmentPath ( fsPath , nativeFinder , api , baseManager ) ;
0 commit comments