User Tools

Site Tools


jupyter_notebook

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
jupyter_notebook [2021/02/15 12:16]
jordan
jupyter_notebook [2023/03/08 16:09] (current)
xujianglong ↷ Page moved from 内部资料:jupyter_notebook to jupyter_notebook
Line 8: Line 8:
 Python高级用户可以使用Pip安装,安装包名称是jupyter Python高级用户可以使用Pip安装,安装包名称是jupyter
  
 +====== 启动 ======
 +<code bash>
 +jupyter notebook
 +# 指定端口
 +jupyter notebook --port <port_number>
 +# 不自动打开浏览器
 +jupyter notebook --no-browser
 +</code>
 +
 +====== 远程访问 ======
 +
 +详见:[[https://www.jianshu.com/p/8fc3cd032d3c|远程访问服务器Jupyter Notebook的两种方法]]
 +
 +  * 生成默认配置文件
 +<code bash>
 +jupyter notebook --generate-config
 +</code>
 +  * 生成访问密码(token)
 +终端输入''ipython'',设置你自己的jupyter访问密码,注意复制输出的sha1:xxxxxxxx密码串:
 +
 +<code bash>
 +In [1]: from notebook.auth import passwd
 +In [2]: passwd()
 +Enter password:
 +Verify password:
 +Out[2]: 'sha1:xxxxxxxxxxxxxxxxx'
 +</code>
 +
 +  * 修改./jupyter/jupyter_notebook_config.py中对应行如下
 +
 +<code bash>
 +c.NotebookApp.ip='*'
 +c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
 +c.NotebookApp.open_browser = False
 +c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口
 +</code>
 +
 +随后启动jupyter即可在同一网络中的任意电脑浏览器访问
jupyter_notebook.1613362608.txt.gz · Last modified: 2021/02/15 12:16 by jordan