Skip to content

Commit 1eef553

Browse files
author
minjk-bl
committed
Edit install code for jupyterlite
1 parent 78ae30e commit 1eef553

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

visualpython/js/m_apps/PDF.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ define([
2121
'vp_base/js/com/component/FileNavigation'
2222
], function(pdfHtml, pdfCss, com_String, com_interface, PopupComponent, FileNavigation) {
2323

24-
const PDF_SHOW = '!pip show PyMuPDF nltk'
25-
const PDF_INSTALL1 = '!pip install PyMuPDF'
26-
const PDF_INSTALL2 = '!pip install nltk'
24+
var PDF_SHOW = '!pip show PyMuPDF nltk'
25+
var PDF_INSTALL1 = '!pip install PyMuPDF'
26+
var PDF_INSTALL2 = '!pip install nltk'
2727

2828
const PDF_IMPORT = `import pandas as pd
2929
import fitz
@@ -80,6 +80,12 @@ nltk.download('punkt')`;
8080
vp_pdfReturn: '',
8181
...this.state
8282
}
83+
84+
if (vpConfig.extensionType === 'lite') {
85+
PDF_SHOW = PDF_SHOW.replace('!', '%');
86+
PDF_INSTALL1 = PDF_INSTALL1.replace('!', '%');
87+
PDF_INSTALL2 = PDF_INSTALL2.replace('!', '%');
88+
}
8389
}
8490

8591
_bindEvent() {

visualpython/js/m_stats/Anova.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,11 @@ define([
252252
}
253253

254254
if (tukey === true || scheffe === true || duncan === true) {
255-
codeList.push("!pip install scikit-posthocs");
255+
if (vpConfig.extensionType === 'lite') {
256+
codeList.push("%pip install scikit-posthocs");
257+
} else {
258+
codeList.push("!pip install scikit-posthocs");
259+
}
256260

257261
// Post hoc analysis - Tukey
258262
if (tukey === true) {
@@ -379,7 +383,11 @@ define([
379383
}
380384
if (tukey === true || scheffe === true || duncan === true) {
381385
// Add installation code
382-
codeList.push("!pip install scikit-posthocs");
386+
if (vpConfig.extensionType === 'lite') {
387+
codeList.push("%pip install scikit-posthocs");
388+
} else {
389+
codeList.push("!pip install scikit-posthocs");
390+
}
383391

384392
// Post hoc analysis - Tukey
385393
if (tukey === true) {
@@ -445,7 +453,11 @@ define([
445453
}
446454

447455
// Add installation code : # pip install pingouin
448-
codeList.push("!pip install pingouin");
456+
if (vpConfig.extensionType === 'lite') {
457+
codeList.push("%pip install pingouin");
458+
} else {
459+
codeList.push("!pip install pingouin");
460+
}
449461

450462
code.appendLine();
451463
code.appendLine();

0 commit comments

Comments
 (0)