可能很明显我不见了,或者Sagemaker不支持这些扩展,但是我一直在尝试通过生命周期配置为我的Sagemaker笔记本启用toc2(目录)jupyter扩展,但无论如何原因仍然没有显示。
我构建了脚本,结合了示例AWS脚本和关于启用扩展的常用方法的快速文章:
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
谢谢!
#!/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