#!/bin/bash
pip install jupyter notebook
pip install ipykernel
jupyter notebook --generate-config
echo "c.NotebookApp.ip='*'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.token='YourPassWord'" >> ~/.jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser=False" >> ~/.jupyter/jupyter_notebook_config.py
pip install autopep8
pip uninstall jupyter_contrib_nbextensions
echo "============================================开始环境部署======================================="
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
pip install --user jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
echo "=============================================环境部署完毕======================================="
jupyter notebook
bash 执行上面的shell脚本,其中在echo "c.NotebookApp.token='YourPassWord'" >> ~/.jupyter/jupyter_notebook_config.py
这里,替换YourPassWord
为自己的密码。不过这个密码是显式的,只能自己用,对于有保密要求的代码,不要这么做。
执行完毕之后,输入公网ip:8888
就可以访问了。