File tree 2 files changed +21
-7
lines changed
src/client/pythonEnvironments
common/environmentManagers 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,21 @@ export class CondaEnvironmentLocator extends Locator<BasicEnvInfo> {
18
18
19
19
const envs = await conda . getEnvList ( ) ;
20
20
for ( const env of envs ) {
21
- const executablePath = await conda . getInterpreterPathForEnvironment ( env ) ;
22
- if ( executablePath !== undefined ) {
23
- traceVerbose ( `Found conda environment: ${ executablePath } ` ) ;
24
- try {
25
- yield { kind : PythonEnvKind . Conda , executablePath, envPath : env . prefix } ;
26
- } catch ( ex ) {
27
- traceError ( `Failed to process environment: ${ executablePath } ` , ex ) ;
21
+ try {
22
+ traceVerbose ( `Looking into conda env for executable: ${ JSON . stringify ( env ) } ` ) ;
23
+ const executablePath = await conda . getInterpreterPathForEnvironment ( env ) ;
24
+ if ( executablePath !== undefined ) {
25
+ traceVerbose ( `Found conda environment: ${ executablePath } ` ) ;
26
+ try {
27
+ yield { kind : PythonEnvKind . Conda , executablePath, envPath : env . prefix } ;
28
+ } catch ( ex ) {
29
+ traceError ( `Failed to process environment: ${ executablePath } ` , ex ) ;
30
+ }
31
+ } else {
32
+ traceError ( `Executable for conda env not found: ${ JSON . stringify ( env ) } ` ) ;
28
33
}
34
+ } catch ( ex ) {
35
+ traceError ( `Failed to get executable for conda env: ${ JSON . stringify ( env ) } ` , ex ) ;
29
36
}
30
37
}
31
38
}
Original file line number Diff line number Diff line change @@ -482,13 +482,19 @@ export class Conda {
482
482
public async getInterpreterPathForEnvironment ( condaEnv : CondaEnvInfo ) : Promise < string | undefined > {
483
483
const executablePath = await getInterpreterPath ( condaEnv . prefix ) ;
484
484
if ( executablePath ) {
485
+ traceVerbose ( 'Found executable for conda env' , JSON . stringify ( condaEnv ) ) ;
485
486
return executablePath ;
486
487
}
488
+ traceVerbose (
489
+ 'Executable does not exist within conda env, running conda run to get it' ,
490
+ JSON . stringify ( condaEnv ) ,
491
+ ) ;
487
492
return this . getInterpreterPathUsingCondaRun ( condaEnv ) ;
488
493
}
489
494
490
495
@cache ( - 1 , true )
491
496
private async getInterpreterPathUsingCondaRun ( condaEnv : CondaEnvInfo ) {
497
+ traceVerbose ( 'Preparing args for conda run' , JSON . stringify ( condaEnv ) ) ;
492
498
const runArgs = await this . getRunPythonArgs ( condaEnv ) ;
493
499
if ( runArgs ) {
494
500
try {
@@ -498,6 +504,7 @@ export class Conda {
498
504
traceError ( `Failed to process environment: ${ JSON . stringify ( condaEnv ) } ` , ex ) ;
499
505
}
500
506
}
507
+ traceError ( 'No executable found for conda env' , JSON . stringify ( condaEnv ) ) ;
501
508
return undefined ;
502
509
}
503
510
You can’t perform that action at this time.
0 commit comments