Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebooks: Fix pip installation not working #14506

Merged
merged 6 commits into from
Mar 4, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extensions/notebook/src/jupyter/jupyterServerInstallation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
if (!pythonExists || forceInstall) {
await this.installPythonPackage(backgroundOperation, this._usingExistingPython, this._pythonInstallationPath, this.outputChannel);
}
// upgrade pip to make sure the right version is installed
let cmd = `"${this._pythonExecutable}" -m pip install --upgrade pip`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this only affects the New Install option, should we skip this upgrade when _usingExistingPython is true? We wouldn't want to force upgrade a user's pip packages as a side effect of another install.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense.

await this.executeBufferedCommand(cmd);
await this.upgradePythonPackages(forceInstall, packages);
} catch (err) {
this.outputChannel.appendLine(msgDependenciesInstallationFailed(utils.getErrorMessage(err)));
Expand Down