1.安装anaconda
2.配置jupyter notebook
jupyter notebook --generate-config
3.在ipython中获取token
In [1]: from notebook.auth import passwd
In [2]: passwd()
4.修改jupyter配置文件
vi ~/.jupyter/jupyter_notebook_config.py
在后面加入
c.NotebookApp.ip='*'
c.NotebookApp.password = u'把上面的文本粘贴到这里'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888
5.在后台启动jupyter
这里可以用screen指令方法,开启一个会话,在里面运行jupyter 这样可以防止连接中断程序退出
还可以使用后台运行 jupyter notebook &
note:阿里云服务器
这里需要额外的东西,设置安全组规则,很简单看,多看官网资料,https://help.aliyun.com/document_detail/25475.html?spm=5176.2020520101.0.0.9b524df5q1BwcR#allowHttp(曾今我就是不看资料,百度浪费了2天时间)
设置防火墙,开放一些端口,我开放的是8888端口
ufw allow 8888/tcp
参考资料:
1.https://blog.youkuaiyun.com/qq_34447388/article/details/79873548
2.https://yq.aliyun.com/articles/98527
3.https://help.aliyun.com/document_detail/25475.html?spm=5176.2020520101.0.0.9b524df5q1BwcR#allowHttp