Skip to content

Commit

Permalink
Handle empty pip package list during python installation (#25332)
Browse files Browse the repository at this point in the history
  • Loading branch information
corivera authored Feb 16, 2024
1 parent 2452651 commit 5a87a75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions extensions/notebook/src/jupyter/jupyterServerInstallation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
if (!this._usingExistingPython && process.platform === constants.winPlatform) {
let packages: PythonPkgDetails[] = await this.getInstalledPipPackages(this._pythonExecutable);
let pip: PythonPkgDetails = packages.find(x => x.name === 'pip');
let cmd = `"${this._pythonExecutable}" -m pip install --force-reinstall pip=="${pip.version}"`;
await this.executeBufferedCommand(cmd);
if (pip) {
let cmd = `"${this._pythonExecutable}" -m pip install --force-reinstall pip=="${pip.version}"`;
await this.executeBufferedCommand(cmd);
}
}
}
await this.upgradePythonPackages(forceInstall, packages);
Expand Down

0 comments on commit 5a87a75

Please sign in to comment.