安装 plotly 扩展后,Jupyter 实验室构建失败

时间:2021-07-22 20:40:51

标签: installation pip plotly windows-subsystem-for-linux jupyter-lab

在 jupyterlab 中不渲染/显示情节图。因此,我尝试安装扩展 jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyterlab-plotly。之后,我被要求运行 jupyter 实验室构建,但失败了。我不知道问题出在哪里。我尝试过网络,但我很想寻求建议。

安装信息: 我用 pyenv 安装了一个 venv,运行 python 3.8.5。

jupyter --version jupyter 核心:4.7.1 jupyter 笔记本:6.4.0 qtconsole : 未安装 ipython:7.25.0 ipykernel:6.0.3 jupyter 客户端:6.1.12 jupyter 实验室:3.0.12 nbconvert:6.1.0 ipywidgets:7.6.3 nb 格式:5.1.3 特质:5.0.5

npm --version 7.11.2

节点 --version v16.1.0

由于公司要求,我被限制使用 WSL1。

我将在命令输出下方发布

  • jupyter 实验室扩展列表
  • jupyter 实验室构建
  • cat /tmp/jupyterlab-debug-5vr2zquq.log
  • jupyter labextension install @jupyter-widgets/jupyterlab-manager --minimize=False

任何建议将不胜感激。我不知道如何解决这个问题。 谢谢

❯ jupyter labextension list
JupyterLab v3.0.16
/home/bebop/.local/share/jupyter/labextensions
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

/mnt/s/dokumente/Privat/neue_fische/ot/ot-sopra_steria/.venv/share/jupyter/labextensions
jupyterlab-plotly v5.1.0 enabled OK

Other labextensions (built into JupyterLab)
app dir: /mnt/s/dokumente/Privat/neue_fische/ot/ot-sopra_steria/.venv/share/jupyter/lab
plotlywidget v4.14.3 enabled OK

Build recommended, please run jupyter lab build:
plotlywidget needs to be included in build
❯ jupyter lab build
[LabBuildApp] JupyterLab 3.0.16
[LabBuildApp] Building in /mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab
[LabBuildApp] Building jupyterlab assets (production, minimized)
Build failed.
Troubleshooting: If the build failed due to an out-of-memory error, you
may be able to fix it by disabling the dev_build and/or minimize options.

If you are building via the jupyter lab build command, you can disable
these options like so:

jupyter lab build --dev-build=False --minimize=False

You can also disable these options for all JupyterLab builds by adding these
lines to a Jupyter config file named jupyter_config.py:

c.LabBuildApp.minimize = False
c.LabBuildApp.dev_build = False

If you don’t already have a jupyter_config.py file, you can create one by
adding a blank file of that name to any of the Jupyter config directories.
The config directories can be listed by running:

jupyter --paths

Explanation:

    dev-build: This option controls whether a dev or a more streamlined
    production build is used. This option will default to False (i.e., the
    production build) for most users. However, if you have any labextensions
    installed from local files, this option will instead default to True.
    Explicitly setting dev-build to False will ensure that the production
    build is used in all circumstances.

    minimize: This option controls whether your JS bundle is minified
    during the Webpack build, which helps to improve JupyterLab’s overall
    performance. However, the minifier plugin used by Webpack is very memory
    intensive, so turning it off may help the build finish successfully in
    low-memory environments.

An error occured.
shutil.Error: [(’/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/staging/templates’, ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’, “[Errno 13] Permission denied: ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’”)]
See the log file for details: /tmp/jupyterlab-debug-5vr2zquq.log
❯ cat /tmp/jupyterlab-debug-5vr2zquq.log
[LabBuildApp] Building in /mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab
[LabBuildApp] Node v16.1.0

[LabBuildApp] Yarn configuration loaded.
[LabBuildApp] Building jupyterlab assets (production, minimized)
[LabBuildApp] Traceback (most recent call last):

[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/debuglog.py”, line 47, in debug_logging
yield

[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/labapp.py”, line 166, in start
raise e

[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/labapp.py”, line 162, in start
build(name=self.name, version=self.version,

[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/commands.py”, line 469, in build
return handler.build(name=name, version=version, static_url=static_url,

[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/commands.py”, line 657, in build
self._populate_staging(

[LabBuildApp] File “/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/commands.py”, line 1180, in _populate_staging
shutil.copytree(pjoin(HERE, ‘staging’, ‘templates’), templates)

[LabBuildApp] File “/home/bebop/.pyenv/versions/3.8.5/lib/python3.8/shutil.py”, line 554, in copytree
return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,

[LabBuildApp] File “/home/bebop/.pyenv/versions/3.8.5/lib/python3.8/shutil.py”, line 510, in _copytree
raise Error(errors)

[LabBuildApp] shutil.Error: [(’/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/staging/templates’, ‘/mnt/s/dokumente/Privatpath/.venv/share/jupyter/lab/staging/templates’, “[Errno 13] Permission denied: ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’”)]

[LabBuildApp] Exiting application: JupyterLab
❯ jupyter labextension install @jupyter-widgets/jupyterlab-manager --minimize=False

Building jupyterlab assets (production, not minimized)
An error occured.
shutil.Error: [(’/mnt/s/dokumente/Privat/path/.venv/lib/python3.8/site-packages/jupyterlab/staging/templates’, ‘/mnt/s/dokumente/path/.venv/share/jupyter/lab/staging/templates’, “[Errno 13] Permission denied: ‘/mnt/s/dokumente/Privat/path/.venv/share/jupyter/lab/staging/templates’”)]

1 个答案:

答案 0 :(得分:1)

您不需要从源代码安装扩展。 JupyterLab 3.0 引入了预构建的扩展系统,该系统允许用户从 pip(和 conda)安装扩展,而无需构建步骤,从而消除了对失败构建进行故障排除的所有麻烦。您似乎使用了一套旧的安装说明来安装 plotly,因为 plotly 5.0+ 支持 JupyterLab 的预构建扩展。首先卸载你刚刚安装的源扩展(不需要):

jupyter labextension uninstall @jupyter-widgets/jupyterlab-manager jupyterlab-plotly plotlywidget

可选:验证扩展列表:

jupyter labextension list

然后使用 pip 或 conda 安装一个新的 plotly 版本:

pip install "plotly>=5" "ipywidgets>=7.6"
# or, if using conda:
# conda install -c conda "plotly>=5"
# conda install "ipywidgets>=7.6"

同时包含小部件和渲染器,因此无需单独安装 plotlywidget

再次检查扩展列表:

jupyter labextension list

您现在应该看到带有以下内容的行:

jupyterlab-plotly v5.1.0 enabled OK
@jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

(当然以后版本可能会更新)。