@@ -296,6 +296,7 @@ define([
296
296
* - automatically restart on jupyter kernel restart (loadVisualpython.js)
297
297
*/
298
298
readKernelFunction ( ) {
299
+ let that = this ;
299
300
// CHROME: change method to load py files ($.get -> require)
300
301
return new Promise ( function ( resolve , reject ) {
301
302
var libraryList = [
@@ -314,7 +315,26 @@ define([
314
315
libraryList . forEach ( libCode => {
315
316
promiseList . push ( vpKernel . execute ( libCode , true ) ) ;
316
317
} ) ;
317
-
318
+
319
+ if ( that . extensionType === 'lite' ) {
320
+ let preInstallCode = '' ;
321
+ let preInstallPackList = [
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
+
318
338
// run all promises
319
339
let failed = false ;
320
340
Promise . all ( promiseList ) . then ( function ( resultObj ) {
@@ -918,7 +938,7 @@ define([
918
938
'- Save VP Note before refreshing the page.'
919
939
] ;
920
940
com_interface . insertCell ( 'markdown' , info . join ( '\n' ) ) ;
921
- com_interface . insertCell ( 'code' , "import piplite\npiplite. install(' jupyterlab-visualpython==" + latestVersion + "')" ) ;
941
+ com_interface . insertCell ( 'code' , "%pip install jupyterlab-visualpython==" + latestVersion ) ;
922
942
}
923
943
924
944
// update version_timestamp
0 commit comments