【问题标题】:How to install Tensorboard extension to Jupyter Lab on AWS EC2?如何在 AWS EC2 上将 Tensorboard 扩展安装到 Jupyter Lab?
【发布时间】:2021-06-07 13:28:30
【问题描述】:

我想将 Temsorboard 安装到 AWS EC2 上的 Jupyter 实验室,但它不起作用。 我有与此post 类似的问题。

出于安全考虑,我不想像某些人建议的那样打开防火墙的问题。所以这个答案并不能解决我的情况。而且我不明白为什么它不能这样做,因为我可以使用 anaconda 下载、安装、删除、更新任何软件包,总体而言,防火墙似乎不会对其他任何地方产生负面影响。

环境

  • EC2 环境
  • Ubuntu 18.04
  • SageMaker 实例
  • Anaconda 环境

我经常遇到这个问题,即没有安装扩展程序并且可以从扩展程序中运行。例如:在 GUI 中,我搜索了 tensorboard click to install than

Build Recommended
JupyterLab build is suggested:
jupyterlab_tensorboard needs to be included in build

点击BUILD

输出Build failed with 500, please run 'jupyter lab build' on the server for full output

输入:jupyter lab build

输出:

[LabBuildApp] JupyterLab 1.2.6
[LabBuildApp] Building in /home/ubuntu/anaconda3/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: npm dependencies failed to install
See the log file for details:  /tmp/jupyterlab-debug-lctnnmuf.log

错误信息日志:

nano /tmp/jupyterlab-debug-f61pajsv.log

输出:

[LabBuildApp] Building in /home/ubuntu/anaconda3/share/jupyter/lab
[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Node v6.13.1

[LabBuildApp] Building jupyterlab assets (build:prod:minimize)
[LabBuildApp] > node /home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js install --non-int$
[LabBuildApp] yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error ws@7.2.1: The engine "node" is incompatible with this module. Expected version ">=8.3.0". Got "6.13.1"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

[LabBuildApp] npm dependencies failed to install
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp]   File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_$
    yield

[LabBuildApp]   File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab/labapp.py", line 98, in start
    command=command, app_options=app_options)

[LabBuildApp]   File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 459, in build
    command=command, clean_staging=clean_staging)

[LabBuildApp]   File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 660, in build
    raise RuntimeError(msg)

[LabBuildApp] RuntimeError: npm dependencies failed to install

[LabBuildApp] Exiting application: JupyterLab

输入:sudo jupyter lab build

输出:

Traceback (most recent call last):
  File "/usr/local/bin/jupyter", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/dist-packages/jupyter_core/command.py", line 285, in main
    command = _jupyter_abspath(subcommand)
  File "/usr/local/lib/python3.6/dist-packages/jupyter_core/command.py", line 125, in _jupyter_abspath
    'Jupyter command `{}` not found.'.format(jupyter_subcommand)
Exception: Jupyter command `jupyter-lab` not found.

【问题讨论】:

    标签: node.js amazon-web-services tensorflow tensorboard jupyter-lab


    【解决方案1】:

    https://github.com/jupyterlab/jupyterlab/issues/10358#issuecomment-860080291回答

    鉴于此消息:

    error ws@7.2.1: The engine "node" is incompatible with this module. Expected version ">=8.3.0". Got "6.13.1"
    

    还有这个:

    [LabBuildApp] Node v6.13.1
    

    看起来您正在使用一个过时的 node.js 版本。如果您担心安全性,您应该升级到受支持的 Node.js 版本。 Node 的当前 LTS 版本是 14.17.0(所以你落后了四个 LTS 版本 - 我会害怕使用这样的设置),最新版本是 16.3。我建议升级到节点 12(不太理想)或节点 14(最佳)。

    升级 Node.js 时,您很可能还需要更新 JupyterLab,无论如何我都会在您运行时推荐:

    [LabBuildApp] JupyterLab 1.2.6
    

    而当前的 JupyterLab 版本是 3.0.16(3.1 即将发布);我强烈建议至少升级到最新的 2.x 版本(或直接升级到 3.x 系列);自 1.2.6 版本以来有许多安全修复。

    还请注意,从 JupyterLab 3.0 开始,可以安装许多扩展,而根本不需要 Node.js。我现在知道 tensorboard 扩展是否属于这种情况 - 最好与作者核实一下。

    【讨论】:

      猜你喜欢
      • 2021-01-10
      • 2019-11-11
      • 1970-01-01
      • 2021-07-05
      • 1970-01-01
      • 1970-01-01
      • 2019-03-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多