installation - 安装 plotly 扩展后 Jupyter 实验室构建失败
问题描述
在 jupyterlab 中不渲染/显示 Plotly 图形。因此,我尝试安装扩展 jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyterlab-plotly。之后我被要求运行 jupyter 实验室构建,但失败了。我不知道问题出在哪里。
安装信息: 我安装了一个带有 pyenv 运行 python 3.8.5 的 venv。
jupyter --version jupyter 核心:4.7.1 jupyter-notebook:6.4.0 qtconsole:未安装 ipython:7.25.0 ipykernel:6.0.3 jupyter 客户端:6.1.12 jupyter lab:3.0.12 nbconvert:6.1.0 ipywidgets: 7.6.3 nbformat:5.1.3 traitlets:5.0.5
npm --版本 7.11.2
节点--版本 v16.1.0
由于公司要求,我只能使用 WSL1。
我将在命令输出下方发布
- jupyter lab扩展列表
- jupyter 实验室构建
- 猫 /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’”)]
解决方案
您不需要从源代码安装扩展。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)
(当然,将来版本可能会更新)。
推荐阅读
- asp.net-core - 支持来自 Blazor WebAssembly 的本机操作系统 API
- spring-boot - @DirtiesContext 不适用于 @Nested 测试
- reactjs - 我有一个 JSX.Element 的道具。我如何在玩笑测试中模拟相同的东西
- algorithm - 有序图伪代码中的最长路径
- javascript - 用于搜索特定行星的搜索栏
- arrays - Bash 与 Zsh:一个带有示例的数组问题
- r - 如何将日期时间格式的列转换为仅一年?
- c# - ScrollViewer 在设定的时间间隔内自动滚动到底部和顶部
- r - (R) 将列从名称重命名为响应时间序列
- python - Pyppeteer 没有正确提取 javascript 覆盖率