Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78ae30e

Browse files
author
minjk-bl
committed
Add installation of preinstall packages for jupyterlite
1 parent78d2f4a commit78ae30e

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

‎visualpython/js/com/com_Config.js‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ define([
296296
* - automatically restart on jupyter kernel restart (loadVisualpython.js)
297297
*/
298298
readKernelFunction(){
299+
letthat=this;
299300
// CHROME: change method to load py files ($.get -> require)
300301
returnnewPromise(function(resolve,reject){
301302
varlibraryList=[
@@ -314,7 +315,26 @@ define([
314315
libraryList.forEach(libCode=>{
315316
promiseList.push(vpKernel.execute(libCode,true));
316317
});
317-
318+
319+
if(that.extensionType==='lite'){
320+
letpreInstallCode='';
321+
letpreInstallPackList=[
322+
'seaborn',
323+
'plotly',
324+
'scikit-learn',
325+
'scipy',
326+
'statsmodels'
327+
];
328+
preInstallPackList.forEach((packName,idx)=>{
329+
preInstallCode+='%pip install '+packName
330+
if(idx<preInstallPackList.length-1){
331+
preInstallCode+='\n';
332+
}
333+
});
334+
// pre-install packages
335+
promiseList.push(vpKernel.execute(preInstallCode,true));
336+
}
337+
318338
// run all promises
319339
letfailed=false;
320340
Promise.all(promiseList).then(function(resultObj){
@@ -918,7 +938,7 @@ define([
918938
'- Save VP Note before refreshing the page.'
919939
];
920940
com_interface.insertCell('markdown',info.join('\n'));
921-
com_interface.insertCell('code',"import piplite\npiplite.install('jupyterlab-visualpython=="+latestVersion+"')");
941+
com_interface.insertCell('code',"%pipinstalljupyterlab-visualpython=="+latestVersion);
922942
}
923943

924944
// update version_timestamp

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp