在笔记本启动时安装jupyterlab扩展

时间:2020-05-04 16:50:31

标签: amazon-web-services jupyter-notebook amazon-sagemaker jupyter-lab

每次笔记本关机并重新启动时,我都会丢失插件,而必须从终端重新安装它们 有没有办法将jupyterlab扩展设置为在启动sagemaker笔记本时自动安装? 我要安装的插件是:

jupyter nbextension enable --py widgetsnbextension
jupyter labextension install @jupyter-widgets/jupyterlab-manager

任何见识都会受到赞赏

1 个答案:

答案 0 :(得分:1)

每次笔记本实例启动时,都可以使用Lifecycle Configuration安装扩展。

有一些用于安装JupyterLab扩展[1]和NBExtension [2]的示例生命周期配置脚本。

[1] https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/blob/master/scripts/install-lab-extension/on-start.sh

[2] https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/blob/master/scripts/install-nb-extension/on-start.sh