python - 建议使用 JupyterLab 构建并成功安装,但无法工作。为什么?

标签 python plotly jupyter jupyter-lab

我正在从 Anaconda 运行 JupyterLab,并安装了 JupyterLab plotly extension使用:

conda install -c conda-forge jupyterlab-plotly-extension

显然,安装成功了,但还是有问题。 启动 JuyterLab 时,我收到此提示:

enter image description here

点击BUILD给我这个:

enter image description here

然后单击RELOAD 重新加载 JupyterLab,但我再次收到此消息:

enter image description here

它不停地旋转。有谁知道为什么吗?

点击CANCEL也没有帮助,因为plotly不会产生任何图,只会产生blank spaces :

enter image description here

最佳答案

解决方案:

停用防火墙并在 Windows 命令提示符中运行以下命令:

jupyter lab build
<小时/>

详细信息:

这原来是防火墙问题,我不知道为什么在 JupyterLab 界面中不会出现这样的提示。 Windows 命令提示符中的以下命令返回以下错误消息:

命令:

jupyter lab build

输出:

C:>jupyter labextension list JupyterLab v0.34.9 Known labextensions: app dir: C:\Users*******\AppData\Local\Continuum\anaconda3\share\jupyter\lab @jupyterlab/plotly-extension v0.18.2 enabled ok

Build recommended, please run jupyter lab build: @jupyterlab/plotly-extension needs to be included in build

C:>jupyter lab build [LabBuildApp] JupyterLab 0.34.9 [LabBuildApp] Building in C:\Users*******\AppData\Local\Continuum\anaconda3\share\jupyter\lab [LabBuildApp] > node C:\Users*******\AppData\Local\Continuum\anaconda3\lib\site-packages\jupyterlab\staging\yarn.js install yarn install v1.9.4 info No lockfile found. [1/4] Resolving packages... error An unexpected error occurred: "https://registry.yarnpkg.com/@jupyterlab%2fapplication: self signed certificate in certificate chain". info If you think this is a bug, please open a bug report with the information provided in "C:\Users\*******\AppData\Local\Continuum\anaconda3\share\jupyter\lab\staging\yarn-error.log".

这部分让我怀疑防火墙问题:

self signed certificate in certificate chain

在不太严格的防火墙设置上运行相同的命令会触发此输出(缩短):

WARNING in d3-array Multiple versions of d3-array found: 1.2.4 ./~/d3-scale/~/d3-array from ./~/d3-scale/~/d3-array\src\index.js 2.2.0 ./~/d3-array from ./~/d3-array\src\index.js

Check how you can resolve duplicate packages: https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#resolving-duplicate-packages-in-your-bundle

Child html-webpack-plugin for "index.html": 1 asset Entrypoint undefined = index.html [KTNU] ./node_modules/html-loader!./templates/partial.html 567 bytes {0} [built] [YuTi] (webpack)/buildin/module.js 497 bytes {0} [built] [aS2v] ./node_modules/html-webpack-plugin/lib/loader.js!./templates/template.html 1.22 KiB {0} [built] [yLpj] (webpack)/buildin/global.js 489 bytes {0} [built] + 1 hidden module

尽管有一些警告消息,JupyterLab 现在可以毫无问题地生成绘图:

enter image description here

关于python - 建议使用 JupyterLab 构建并成功安装,但无法工作。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56425283/

相关文章:

python - Plotly:躲避散点图分类轴上的重叠点

JupyterLab : How to save a figure from the notebook

python - 在 python 中对数据框进行子集化时出错

python - 将 XGBClassifier 模型转储到文本中

python - 在 Plotly 中,使用 HTML,为什么一些希腊字母可以使用小数而不是实体名称?

plotly - 反转使用plotly制作的子图的轴

Python 出现奇怪的 HTTP 错误

Python 多重赋值会引发错误,但单独赋值不会

python - jupyter如何访问安装在正确路径中的新tensorflow模块?

python - Anaconda Jupyter笔记本使用/usr/bin/python3