当前位置:   article > 正文

Ubuntu 20.04.2 LTS 安装juypterlab_the specific browser used is platform dependent an

the specific browser used is platform dependent and

Ubuntu 20.04.2 LTS 安装 jupyterlab

创建Python虚拟环境

$ mkvirtualenv jupyterlab
  • 1

详细了解Python安装虚拟环境

安装jupyterlab

$ workon jupyterlab
(jupyterlab) $ pip3 install jupyterlab
  • 1
  • 2

生成jupyterlab配置文件

(jupyterlab) $ jupyter lab --generate-config
  • 1

修改jupyterlab配置文件:

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

    ## The IP address the Jupyter server will listen on.
    #  Default: 'localhost'
    c.ServerApp.ip = '0.0.0.0'
    
    • 1
    • 2
    • 3
  • 启动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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

设置jupyterlab密码

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

防火墙打开端口

# 查询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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16

启动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).

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

访问jupyterlab

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

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/297823
推荐阅读
  

闽ICP备14008679号