无法为AWS Sagemaker实例安装toc2笔记本扩展(生命周期配置)

问题描述 投票:0回答:1

可能很明显我不见了,或者Sagemaker不支持这些扩展,但是我一直在尝试通过生命周期配置为我的Sagemaker笔记本启用toc2(目录)jupyter扩展,但无论如何原因仍然没有显示。

我构建了脚本,结合了示例AWS脚本和关于启用扩展的常用方法的快速文章:

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

https://towardsdatascience.com/jupyter-notebook-extensions-517fa69d2231

#!/bin/bash

set -e
sudo -u ec2-user -i <<EOF

--Activate notebook environment
source activate JupyterSystemEnv

--Install extensions
pip install jupyter_contrib_nbextensions && jupyter contrib
nbextension install
jupyter nbextension enable toc2 --py --sys-prefix

source deactivate


EOF

谢谢!

python amazon-web-services jupyter-notebook amazon-sagemaker tableofcontents
1个回答
0
投票
#!/bin/bash set -e sudo -u ec2-user -i <<EOF --Activate notebook environment source activate JupyterSystemEnv --Install extensions pip install jupyter_contrib_nbextensions && jupyter contrib nbextension install jupyter nbextension enable toc2 --py --sys-prefix source deactivate EOF initctl restart jupyter-server --no-wait
© www.soinside.com 2019 - 2024. All rights reserved.