天天看點

Jupyter Notebook安裝與使用1 介紹2 安裝3 使用

Python學習過程中我們或許會用到Jupyter Notebook來編寫和運作一些代碼,這裡簡單介紹Jupyter Notebook的安裝與使用。

1 介紹

Jupyter Notebook是基于網頁的用于互動計算的應用程式。其可被應用于全過程計算:開發、文檔編寫、運作代碼和展示結果。——Jupyter Notebook官方介紹

2 安裝

安裝Jupyter Notebook的前提是已經安裝了Python

直接pip安裝

pip3 install jupyter  # python 3.x
pip install jupyter   # python 2.x
           
  • 注意:老版本的pip在安裝Jupyter Notebook過程中或面臨依賴項無法同步安裝的問題。是以強烈建議先把pip更新到最新版本。

3 使用

0 幫助

使用jupyter notebook有疑問可以檢視官方幫助文檔

jupyter notebook --help
或
jupyter notebook -h
           

1 啟動

啟動伺服器後就可以在網頁上使用jupyter notebook,但要注意保持終端不要關閉,一旦關閉終端,就會斷開與本地伺服器的連結,将無法在Jupyter Notebook中進行操作。

jupyter notebook  # 預設啟動
jupyter notebook --port <port_number>  # 指定端口啟動
jupyter notebook --no-browser  # 啟動伺服器但不打開浏覽器
           
Jupyter Notebook安裝與使用1 介紹2 安裝3 使用

啟動後界面

Jupyter Notebook安裝與使用1 介紹2 安裝3 使用

2 使用

Jupyter Notebook安裝與使用1 介紹2 安裝3 使用
Jupyter Notebook安裝與使用1 介紹2 安裝3 使用

建立筆記本後開始使用即可

Jupyter Notebook安裝與使用1 介紹2 安裝3 使用

繼續閱讀