mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Notebooks: Fix pip installation not working (#14506)
* upgrade pip after python installation * add comment * only upgrade pip for new python installations * reinstall pip version instead of upgrade to latest * update comment * get pip version through packages list
This commit is contained in:
@@ -165,6 +165,13 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
let pythonExists = await utils.exists(this._pythonExecutable);
|
||||
if (!pythonExists || forceInstall) {
|
||||
await this.installPythonPackage(backgroundOperation, this._usingExistingPython, this._pythonInstallationPath, this.outputChannel);
|
||||
// reinstall pip to make sure !pip command works
|
||||
if (!this._usingExistingPython) {
|
||||
let packages: PythonPkgDetails[] = await this.getInstalledPipPackages();
|
||||
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);
|
||||
}
|
||||
}
|
||||
await this.upgradePythonPackages(forceInstall, packages);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user