diff --git a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts index 2d42e8acfc..d5e07784e3 100644 --- a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts +++ b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts @@ -288,6 +288,11 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { } public async configurePackagePaths(): Promise { + // Delete existing Python variables in ADS to prevent conflict with other installs + delete process.env['PYTHONPATH']; + delete process.env['PYTHONSTARTUP']; + delete process.env['PYTHONHOME']; + //Python source path up to bundle version let pythonSourcePath = this._usingExistingPython ? this._pythonInstallationPath @@ -329,11 +334,6 @@ export class JupyterServerInstallation implements IJupyterServerInstallation { } } - // Delete existing Python variables in ADS to prevent conflict with other installs - delete process.env['PYTHONPATH']; - delete process.env['PYTHONSTARTUP']; - delete process.env['PYTHONHOME']; - // Store the executable options to run child processes with env var without interfering parent env var. let env = Object.assign({}, process.env); delete env['Path']; // Delete extra 'Path' variable for Windows, just in case.