1、安裝
pip3 install jupyter
2、配置
2.1. 生成一個 notebook 配置文件
jupyter notebook --generate-config
/root/.jupyter/jupyter_notebook_config.py
2.2. 生成密碼
從 jupyter notebook 5.0 版本開始,提供了一個命令來設置密碼:jupyter notebook password
,生成的密碼存儲在 jupyter_notebook_config.json
。
$ jupyter notebook password Enter password: **** Verify password: **** [NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json
2.3. 修改配置文件
在 jupyter_notebook_config.py
中找到下面的行,取消注釋並修改。
c.NotebookApp.ip='*'#163行 c.NotebookApp.password = u'sha:ce...剛才復制的那個密文' #217行 c.NotebookApp.open_browser = False#208 c.NotebookApp.port =8888 #可自行指定一個端口, 訪問時使用該端口228行
3、jupyter運行
juputer notebook --allow-root --port=8889 --ip 192.x.x.x
OR
/usr/local/bin/jupyter-notebook --allow-root --port=8890 --ip 192.xxx
4、升級 【插件】
1. pip install jupyter_contrib_nbextensions
2. jupyter contrib nbextension install --user --skip-running-check
3. 上面兩個步驟都沒報錯后,啟動 Jupyter Notebook,首頁選項欄會出現 Nbextensions 的選項
4. 點開 Nbextensions 的選項,並勾選 Table of Contents
5.打開一個 .ipnb 文件,工具欄就會出現目錄選項,點擊就會生成目錄。