gpt4 book ai didi

python - 如何在虚拟环境中使用 pip nodjs 安装 jupyterlab-plotly labextension?

转载 作者:行者123 更新时间:2023-12-05 02:02:09 25 4
gpt4 key购买 nike

我正在尝试使用此命令安装 jupyterlab plotly 扩展(根据 https://plotly.com/python/getting-started/ ):

jupyter labextension 安装 jupyterlab-plotly@4.14.3

我收到这个错误:

An error occured.
ValueError: Please install Node.js and npm before continuing installation. You may be able to install Node.js from your package manager, from conda, or directly from the Node.js website (https://nodejs.org).
See the log file for details: /tmp/jupyterlab-debug-epx8b4n6.log

我没有在系统级别安装 Node.js,而是在使用 pip 的虚拟环境中。 Pip 列表同时显示 nodejs 0.1.1 和 npm 0.1.1 。我也在 jupyterlab 中使用 ipywidgets,它需要 nodejs 并且工作正常。

所以我有两个问题:

  1. 如何在虚拟环境中使用 plotlywidgets 和 pip nodejs?
  2. pip nodejs 和系统级 Node.js 有什么区别

最佳答案

不,您没有安装 node.js。您为 Node ( python-nodejs ,其 repository 由作者存档)安装了某种 Python 绑定(bind),它本身需要一个实际的 nodejs。从 PyPI 安装东西而不检查你正在安装的东西是危险的。它可能是恶意代码 - 您不应该只在 pip install 之后键入名称并希望它安装您认为的内容。这与您的 npm 安装相同(包来自同一作者);两者在过去 6 年内都没有更新,并且可能包含一些漏洞,所以我会快速卸载它们;)

从版本号可以立即看出有问题,因为当前的 nodejs 版本通常 >10,(具体版本取决于您的 JupyterLab 版本,即 10 或 12;14 也可能工作)。

关于python - 如何在虚拟环境中使用 pip nodjs 安装 jupyterlab-plotly labextension?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66062702/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com