jupyterlab安裝及配置完整教程
=========================================
1、查看pip 版本
#pip -V
如果沒有安裝pip,需要安裝一下
#wget https://bootstrap.pypa.io/get-pip.py
#python get-pip.py
2、安裝jupyterlab
#/usr/bin/pip install jupyterlab
1、pip安裝慢的問題 安裝速度慢是鏡像源的問題,可以參考我的另外一篇文章。
https://www.cnblogs.com/SliverLee/p/13205363.html 2、版本問題

如果出現類似的警告,可以直接輸入#echo $? ,如果返回值為0,就可以直接進行第三步,配置jupyter
3、配置jupyter
#jupyter notebook --generate-config --allow-root
#vim /root/.jupyter/jupyter_notebook_config.py
找到這一行#c.NotebookApp.allow_root = False 去掉#,並修改成True即可解決root權限運行的問題,c.NotebookApp.allow_root =True保存,然后重啟jupyter
#jupyter notebook
4、執行#ipython
In [1]: from notebook.auth import passwd
In [2]: passwd()
兩次確認密碼之后,會得到一個加密的sha1密碼段
sha1:9f7be0ce4275:163fe21b02f70197924ecf93627eb145cce6d52e
然后復制 ‘sha1:9f7be0ce4275:163fe21b02f70197924ecf93627eb145cce6d52e’ 粘貼至配置文件、root/.jupyter/jupyter_notebook_config.py(記得去掉 #)
c.NotebookApp.password = u'sha1:9f7be0ce4275:163fe21b02f70197924ecf93627eb145cce6d52e'
5、其他配置
c.NotebookApp.ip = 'localhost' //設置允許訪問ip
c.NotebookApp.open_browser = True(True:啟動時自動打開瀏覽器,False:需手動打開瀏覽器訪問http://localhost:8888/tree)
c.NotebookApp.port = 8888 //端口設置
6、調至后台運行
jupyter notebook
啟動ipython后不需要我們再做任何輸入,也不能輸入,只能通過當前窗口查看jupyter
的運行情況和運行日志,占用了一個terminal 窗口,完全沒必要。當遠程連接到服務器時,ssh窗口可能會自動斷開,影響程序運行。
1.入門級: jupyter notebook --allow-root > jupyter.log 2>&1 &
2.進階版: nohup jupyter notebook --allow-root > jupyter.log 2>&1 &
jupyter.log這個文件保存交互日志。可以用tail,head等命令查看。