1、使用conda安裝jupyter notebook
conda install jupyter notebook
2、使用域名訪問(wèn)服務(wù)器Jupyter Notebook
[這里參考jlrleung的第一種方法]第二種方法可以一勞永逸(https://blog.csdn.net/weixin_42309722/article/details/111956799)
方法1. ssh遠(yuǎn)程使用jupyter notebook
- 在遠(yuǎn)程服務(wù)器上,啟動(dòng)jupyter notebooks服務(wù):
jupyter notebook --no-browser --port=8889
- 在本地終端中啟動(dòng)SSH:
ssh -N -f -L localhost:8888:localhost:8889 username@serverIP
其中: -N 告訴SSH沒(méi)有命令要被遠(yuǎn)程執(zhí)行; -f 告訴SSH在后臺(tái)執(zhí)行; -L 是指定port forwarding的配置,遠(yuǎn)端端口是8889,本地的端口號(hào)的8888。
注意:username@serverIP替換成服務(wù)器的對(duì)應(yīng)賬號(hào)。
- 如果服務(wù)器沒(méi)有IP地址怎么辦?
-
首先可以在NAT123網(wǎng)站上申請(qǐng)一個(gè)賬號(hào),然后購(gòu)買一個(gè)非80端口網(wǎng)絡(luò)映射服務(wù),一年大概200~300塊。配置如下:
截屏2021-04-28 下午12.03.48.png
效果如下:
截屏2021-04-28 下午12.07.07.png - 如果遇到“連接不是私密連接”,可以將網(wǎng)址前的http改成https;如果還有同學(xué)用的是chrome瀏覽器,在當(dāng)前頁(yè)面輸入thisisunsafe,不是在地址欄輸入,就直接敲鍵盤(pán)就行了,頁(yè)面即會(huì)自動(dòng)刷新進(jìn)入網(wǎng)頁(yè)。
3、安裝NB(牛逼)插件,參考網(wǎng)址鏈接
- 安裝nbextensions
pip3 install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
- 安裝nbextensions_configurator
pip3 install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
- 安裝完成重啟后不顯示Nbextensions
- 先卸載 jupyter_contrib_nbextensions和 jupyter_nbextensions_configurator
pip3 uninstall jupyter_contrib_nbextensions
pip3 uninstall jupyter_nbextensions_configurator
- 使用conda安裝
conda install -c conda-forge jupyter_contrib_nbextensions
重新啟動(dòng),大功告成。

