我是靠谱客的博主 纯真香氛,最近开发中收集的这篇文章主要介绍Ubuntu 20.04.2 LTS 安装juypterlabUbuntu 20.04.2 LTS 安装 jupyterlab,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Ubuntu 20.04.2 LTS 安装 jupyterlab

创建Python虚拟环境

$ mkvirtualenv jupyterlab

详细了解Python安装虚拟环境

安装jupyterlab

$ workon jupyterlab
(jupyterlab) $ pip3 install jupyterlab

生成jupyterlab配置文件

(jupyterlab) $ jupyter lab --generate-config

修改jupyterlab配置文件:

(jupyterlab) $ vim jupyter_lab_config.py
  • 允许任意IP地址访问。

    ## The IP address the Jupyter server will listen on.
    #  Default: 'localhost'
    c.ServerApp.ip = '0.0.0.0'
    
  • 启动jupyterlab时,不打开浏览器。

    ## Whether to open in a browser after starting.
    #                          The specific browser used is platform dependent and
    #                          determined by the python standard library `webbrowser`
    #                          module, unless it is overridden using the --browser
    #                          (ServerApp.browser) configuration option.
    #  Default: False
    c.ServerApp.open_browser = False
    

设置jupyterlab密码

(jupyterlab) $ jupyter lab password
Enter password:
Verify password:
[JupyterPasswordApp] Wrote hashed password to /home/jing/.jupyter/jupyter_server_config.json

防火墙打开端口

# 查询8888端口是否打开
(jupyterlab) $ sudo firewall-cmd --query-port=8888/tcp
no

# 将8888端口开放
(jupyterlab) $ sudo firewall-cmd --add-port=8888/tcp --permanent
success

# 重新载入配置
(jupyterlab) $ sudo firewall-cmd --reload
success

# 查询8888端口是否打开
(jupyterlab) $ sudo firewall-cmd --query-port=8888/tcp
yes

启动jupyterlab

(jupyterlab) $ jupyter lab
[I 2022-10-24 14:39:28.903 ServerApp] jupyterlab | extension was successfully linked.
[I 2022-10-24 14:39:28.911 ServerApp] nbclassic | extension was successfully linked.
[I 2022-10-24 14:39:29.123 ServerApp] jupyterlab | extension was successfully loaded.
[I 2022-10-24 14:39:29.144 ServerApp] nbclassic | extension was successfully loaded.
[I 2022-10-24 14:39:29.144 ServerApp] Jupyter Server 1.21.0 is running at:
[I 2022-10-24 14:39:29.144 ServerApp] http://192.168.110.228:8888/lab
[I 2022-10-24 14:39:29.144 ServerApp]  or http://127.0.0.1:8888/lab
[I 2022-10-24 14:39:29.144 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

访问jupyterlab

  1. 在浏览器中输入http://服务器IP地址:8888/lab。在这里插入图片描述

  2. 访问成功之后,在需要输入密码进入jupyterlab。在这里插入图片描述

最后

以上就是纯真香氛为你收集整理的Ubuntu 20.04.2 LTS 安装juypterlabUbuntu 20.04.2 LTS 安装 jupyterlab的全部内容,希望文章能够帮你解决Ubuntu 20.04.2 LTS 安装juypterlabUbuntu 20.04.2 LTS 安装 jupyterlab所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部