通過瀏覽器實現Ubuntu下的Jupyter互動
阿新 • • 發佈:2022-03-31
通過瀏覽器實現Ubuntu下的Jupyter互動
1、安裝
$ pip3 install -i https://pypi.doubanio.com/simple/ jupyter notebook
找到安裝的jupyter二進位制檔案
$ find / -name jupyter
建立軟連線
$ sudo ln -s /home/hadoop/.local/bin/jupyter /usr/bin/jupyter
2、初始化生成預設配置檔案
$ jupyter notebook --generate-config
根據提示,找到生成的配置檔案jupyter_notebook_config.py 所在目錄,並切換到該目錄下
$ cd /home/hadoop/.jupyter/
3. 輸入 jupyter notebook password 生成密碼,這裡要求進行兩次輸入,請保證兩次相同
$ jupyter notebook password $ Enter password: # 自己手動輸入 例如 123456 $ Verify password:
輸入完相關密碼後,會在當前目錄生成 .jupyter/jupyter_notebook_config.json檔案,裡面存的是加密過後的密碼。
4.使用vim開啟上面的檔案,並將其內容複製下來
$ vim .jupyter/jupyter_notebook_config.json
## 內部可能如下
"argon2:$argon2id$v=19$m=10240,t=10,p=8$yqX7AhTpZL3LTVSyGCnoYQ$3FGc8c3gVpQT609QpVZxiA"
##
5.修改config檔案
$ vim .jupyter/jupyter_notebook_config.json
在 jupyter_notebook_config.py 中找到c.NotebookApp.password ,c.NotebookApp.ip,c.NotebookApp.open_browser 取消註釋並修改如下:
$ c.NotebookApp.ip="*"
## 使用jupyter_notebook_config.json $ c.NotebookApp.password=u'argon2:$argon2id$v=19$m=10240,t=10,p=8$yqX7AhTpZL3LTVSyGCnoYQ$3FGc8c3gVpQT609QpVZxiA'
$ c.NotebookApp.open_browser=False6 修改後,輸入 jupyter notebook 啟動 ,然後在 Windows瀏覽器 輸入 自己Ubuntu的IP:8888/tree ,然後再跳出的介面輸入密碼 123456 參考: 1 https://www.cnblogs.com/andy9468/p/14808101.html 2 https://www.jianshu.com/p/17dca6584dfe 3 https://blog.csdn.net/qq_15220357/article/details/81152957