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. 访问
    在这里插入图片描述
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章