Skip to content

Commit 78d2f4a

Browse files
author
minjk-bl
committed
Edit package manager install code
1 parent 356b68c commit 78d2f4a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

visualpython/js/com/component/PackageManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ define([
148148
var pipName = that.packageLib[key].pipName;
149149
var code = com_util.formatString("!pip uninstall -y {0}", pipName);
150150
if (vpConfig.extensionType === 'lite') {
151-
code = com_util.formatString("import piplite\npiplite.uninstall('{0}')", pipName);
151+
code = com_util.formatString("%pip uninstall {0}", pipName);
152152
}
153153
// create block and run it
154154
$('#vp_wrapper').trigger({
@@ -162,7 +162,7 @@ define([
162162
var pipName = that.packageLib[key].pipName;
163163
var code = com_util.formatString("!pip install --upgrade {0}", pipName);
164164
if (vpConfig.extensionType === 'lite') {
165-
code = com_util.formatString("%pip install --upgrade {0}", pipName);
165+
code = com_util.formatString("%pip install {0}", pipName);
166166
}
167167
// create block and run it
168168
$('#vp_wrapper').trigger({
@@ -269,15 +269,15 @@ define([
269269
var pipName = this.packageLib[this.state.selected].pipName;
270270
var code = com_util.formatString("!pip install {0}", pipName);
271271
if (vpConfig.extensionType === 'lite') {
272-
code = com_util.formatString("import piplite\npiplite.install('{0}')", pipName);
272+
code = com_util.formatString("%pip install {0}", pipName);
273273
}
274274
if (versionType === 'specified') {
275275
// specified version
276276
let version = $(this.wrapSelector('.vp-inner-popup-version')).val();
277277
if (version && version !== '') {
278278
code = com_util.formatString("!pip install {0}=={1}", pipName, version);
279279
if (vpConfig.extensionType === 'lite') {
280-
code = com_util.formatString("import piplite\npiplite.install('{0}=={1}')", pipName, version);
280+
code = com_util.formatString("%pip install {0}=={1}", pipName, version);
281281
}
282282
} else {
283283
$(this.wrapSelector('.vp-inner-popup-version')).focus();

0 commit comments

Comments
 (0)