88 isParentPath ,
99 pathExists ,
1010 readFile ,
11- shellExecute ,
1211 onDidChangePythonSetting ,
1312 exec ,
1413} from '../externalDependencies' ;
@@ -22,8 +21,6 @@ import { cache } from '../../../common/utils/decorators';
2221import { isTestExecution } from '../../../common/constants' ;
2322import { traceError , traceVerbose } from '../../../logging' ;
2423import { OUTPUT_MARKER_SCRIPT } from '../../../common/process/internal/scripts' ;
25- import { buildPythonExecInfo } from '../../exec' ;
26- import { getExecutablePath } from '../../info/executable' ;
2724
2825export const AnacondaCompanyName = 'Anaconda, Inc.' ;
2926export const CONDAPATH_SETTING_KEY = 'condaPath' ;
@@ -483,6 +480,7 @@ export class Conda {
483480 /**
484481 * Returns executable associated with the conda env, swallows exceptions.
485482 */
483+ // eslint-disable-next-line class-methods-use-this
486484 public async getInterpreterPathForEnvironment ( condaEnv : CondaEnvInfo ) : Promise < string | undefined > {
487485 try {
488486 const executablePath = await getInterpreterPath ( condaEnv . prefix ) ;
@@ -491,26 +489,16 @@ export class Conda {
491489 return executablePath ;
492490 }
493491 traceVerbose (
494- 'Executable does not exist within conda env, running conda run to get it ' ,
492+ 'Executable does not exist within conda env, assume the executable to be `python` ' ,
495493 JSON . stringify ( condaEnv ) ,
496494 ) ;
497- return this . getInterpreterPathUsingCondaRun ( condaEnv ) ;
495+ return 'python' ;
498496 } catch ( ex ) {
499497 traceError ( `Failed to get executable for conda env: ${ JSON . stringify ( condaEnv ) } ` , ex ) ;
500498 return undefined ;
501499 }
502500 }
503501
504- @cache ( - 1 , true )
505- private async getInterpreterPathUsingCondaRun ( condaEnv : CondaEnvInfo ) {
506- const runArgs = await this . getRunPythonArgs ( condaEnv ) ;
507- if ( runArgs ) {
508- const python = buildPythonExecInfo ( runArgs ) ;
509- return getExecutablePath ( python , shellExecute , CONDA_ACTIVATION_TIMEOUT ) ;
510- }
511- return undefined ;
512- }
513-
514502 public async getRunPythonArgs ( env : CondaEnvInfo , forShellExecution ?: boolean ) : Promise < string [ ] | undefined > {
515503 const condaVersion = await this . getCondaVersion ( ) ;
516504 if ( condaVersion && lt ( condaVersion , CONDA_RUN_VERSION ) ) {
0 commit comments