安装jupyter

pip3 install jupyterlab

pip3 install notebook

 

 

使用jupyter

jupyter 默认只能通过本地地址访问,要放开配置,允许jupyter远程访问。在放开远程访问时,需要设置密码,jupyter的配置文件只支持加密后的密文密码(赞一个)

#生成jupyter配置文件,这个会生成配置文件.jupyter/jupyter_notebook_config.py
jupyter notebook --generate-config

#使用ipython生成密码
In [1]: from notebook.auth import passwd
In [2]: passwd()
Enter password: 
Verify password: 
Out[2]: 'sha1:38a5ecdf288b:c82dace8d3c7a212ec0bd49bbb99c9af3bae076e'

#去配置文件.jupyter/jupyter_notebook_config.py中修改以下参数
c.NotebookApp.ip='*'                          #绑定所有地址
c.NotebookApp.password = u'刚才生成的密码'
c.NotebookApp.open_browser = False            #启动后是否在浏览器中自动打开
c.NotebookApp.port =8888                      #指定一个访问端口,默认8888,注意和映射的docker端口对应

配置完成以后,就可以用 jupyter notebook命令把jupyter启动起来了,然后你就可以看到一个超级简洁的jupyter登录界面了。输入密码就可以开始使用jupyter了。

clipboard.png

posted @ 2020-06-11 10:38  jiftle  阅读(275)  评论(0编辑  收藏  举报