JupyterLab

JupyterLab是一個交互式的開發環境,是Jupyter Notebook的下一代產品,集成了更多的功能。使用JupyterLab,能夠以靈活,集成和可擴展的方式處理文檔和活動:

  • 可以開啓終端,用於交互式運行代碼,完全支持豐富的輸出
  • 支持Markdown,Python,R,LaTeX等任何文本文件
  • 增強notebook功能
  • 更多插件支持

安裝:

  1. jupyterlab中的有些組件需要依賴node.js,先安裝node.js
  2. 虛擬環境 pip install jupyterlab
  3. 如果使用雲服務器遠程部署,需要安全密碼:
# 進入ipython交互環境
ipython

# 輸入
from notebook.auth import passwd
passwd()
# 輸入設置登錄JupyterLab界面的密碼,複製輸出
  1. 修改JupyterLab 配置文件:
    jupyter lab --generate-config
c.NotebookApp.ip = '127.0.0.1'
c.NotebookApp.allow_root = True
c.NotebookApp.open_browser = False:
c.NotebookApp.password = '上面生成的字符串'
  1. 啓動
    jupyter-lab >/dev/null 2>&1 &
  2. Nginx配置
location ^~ /jupyter/ {
    proxy_pass          http://127.0.0.1:8888/;

    proxy_set_header    Host                $host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
    proxy_set_header    Upgrade             $http_upgrade;
    proxy_set_header    Connection          "upgrade";
    proxy_http_version  1.1;
    proxy_redirect      off;
}
  1. 訪問
    在這裏插入圖片描述
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章