gpt4 book ai didi

node.js - `jupyterlab` 没有 't recognize ` nodejs ` and ` npm` 安装

转载 作者:搜寻专家 更新时间:2023-10-31 23:40:16 25 4
gpt4 key购买 nike

我在安装 jupyterlab_bokeh 扩展时遇到问题。

$ jupyter labextension install jupyterlab_bokeh
Errored, use --debug for full output:
ValueError: Please install nodejs and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.

我正在使用虚拟环境(pyenv 加上 pyenv-virtualenvwrapper)。我尝试先在我的本地操作系统 (Ubuntu 16.04) 上安装这两个包,然后重新安装 jupyterlab 但这没有帮助。我还尝试在虚拟环境中通过 pip 安装 nodejsnpm确定他们没有冲突。不幸的是,这两种尝试都没有成功。

奇怪的是,如果我在终端上键入 nodejs 命令,我可以访问 nodejs REPL。

bokeh==0.12.13
jupyter-client==5.2.1
jupyter-core==4.4.0
jupyterlab==0.31.1
jupyterlab-launcher==0.10.2

问题不仅限于扩展jupyterlab_bokeh。我可以使用扩展名 jupyterlab-manager 复制相同的错误。

我实际上注意到,如果我运行 jupyter labextension list,我可以看到两个扩展都已正确安装:

$ jupyter labextension list
JupyterLab v0.31.1
Known labextensions:
app dir: /home/gianluca/.virtualenvs/rethinking/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager
@jupyter-widgets/jupyterlab-manager v0.33.0 enabled OK
jupyterlab_bokeh
jupyterlab_bokeh v0.2.0 enabled OK

Build recommended, please run `jupyter lab build`:
@jupyter-widgets/jupyterlab-manager needs to be included in build
jupyterlab_bokeh needs to be included in build

但是,正如您在上面的片段中看到的,建议使用内置的。如果我尝试运行构建,这是我看到的错误消息:

$ jupyter lab build
[LabBuildApp] > node /home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/staging/yarn.js install
Traceback (most recent call last):
File "/home/gianluca/.virtualenvs/rethinking/bin/jupyter-lab", line 11, in <module>
sys.exit(main())
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/notebook/notebookapp.py", line 1431, in start
super(NotebookApp, self).start()
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyter_core/application.py", line 255, in start
self.subapp.start()
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/labapp.py", line 64, in start
command=command, logger=self.log)
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/commands.py", line 238, in build
command=command, clean_staging=clean_staging)
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/commands.py", line 376, in build
self._run(['node', YARN_PATH, 'install'], cwd=staging)
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/commands.py", line 1158, in _run
proc = Process(cmd, **kwargs)
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/process.py", line 72, in __init__
self.proc = self._create_process(cwd=cwd, env=env)
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/process.py", line 130, in _create_process
cmd[0] = which(cmd[0], kwargs.get('env'))
File "/home/gianluca/.virtualenvs/rethinking/lib/python3.6/site-packages/jupyterlab/jlpmapp.py", line 59, in which
raise ValueError(msg)
ValueError: Please install nodejs and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.

同样,nodejsnpm 都安装在操作系统中。

最佳答案

问题出在 nodejs 安装的版本上。 Ubuntu 16.04 LTS 附带 v4.2.6。我已经解决了安装 nodejs v6 的问题。如果需要在Ubuntu 16.04 LTS安装,可以关注this excellent tutorial .

关于node.js - `jupyterlab` 没有 't recognize ` nodejs ` and ` npm` 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48290571/

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