首页 > 解决方案 > 在笔记本启动时安装 jupyterlab 扩展

问题描述

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

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

任何见解将不胜感激

标签: amazon-web-servicesjupyter-notebookamazon-sagemakerjupyter-lab

解决方案


Lifecycle Configuration 可用于在您的 Notebook 实例每次启动时安装扩展。

有用于安装 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


推荐阅读