简体   繁体   English

无法通过 Anaconda 使 Jupyter 实验室工作

[英]Can't get Jupyter lab to work via Anaconda

I keep getting the same error message and 404 error :我不断收到相同的错误消息和 404 错误

[I 01:37:29.009 LabApp] The port 8888 is already in use, trying another port.
[I 01:37:29.010 LabApp] The port 8889 is already in use, trying another port.
[I 01:37:29.010 LabApp] The port 8890 is already in use, trying another port.
[I 01:37:29.011 LabApp] The port 8891 is already in use, trying another port.
[I 01:37:29.011 LabApp] The port 8892 is already in use, trying another port.
[I 01:37:29.031 LabApp] JupyterLab beta preview extension loaded from C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab
[I 01:37:29.031 LabApp] JupyterLab application directory is C:\Users\Utilizador\Anaconda3\share\jupyter\lab
[W 01:37:29.036 LabApp] Error loading server extension jupyterlab
Traceback (most recent call last):
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 321, in __init__
self._run(['node', 'node-version-check.js'], cwd=HERE, quiet=True)
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 1165, in _run
proc = Process(cmd, **kwargs)
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\process.py", line 73, in __init__
self.proc = self._create_process(cwd=cwd, env=env)
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\process.py", line 131, in _create_process
cmd[0] = which(cmd[0], kwargs.get('env'))
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\jlpmapp.py", line 59, in which
raise ValueError(msg)
ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1454, in init_server_extensions
func(self)
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\extension.py", line 111, in load_jupyter_server_extension
info = get_app_info(app_dir)
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 244, in get_app_info
handler = _AppHandler(app_dir, logger)
File "C:\Users\Utilizador\Anaconda3\lib\site-packages\jupyterlab\commands.py", line 324, in __init__
raise ValueError(msg)
ValueError: Please install nodejs 5+ and npm before continuing installation. nodejs may be installed using conda or directly from the nodejs website.
[I 01:37:29.143 LabApp] Serving notebooks from local directory: C:\Users\Utilizador
[I 01:37:29.143 LabApp] 0 active kernels
[I 01:37:29.143 LabApp] The Jupyter Notebook is running at:
[I 01:37:29.143 LabApp] http://localhost:8821/?token=3b91702d19818c1d66dc2965898bf2b91a24c5234e0cbd05
[I 01:37:29.143 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 01:37:29.145 LabApp] 
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8821/?token=3b91702d19818c1d66dc2965898bf2b91a24c5234e0cbd05
[I 01:37:29.244 LabApp] Accepting one-time-token-authenticated connection from ::1
[W 01:37:29.307 LabApp] 404 GET /lab?token=f8eabc16b28360868e8c304de5929a0d3b91126814057e49 (::1) 64.17ms referer=None

First part seems to refer to firewall issues, but it does seem to connect eventually.第一部分似乎是指防火墙问题,但它似乎最终连接。 Second part I just don't get.第二部分我就是不明白。

I've tried reinstalling Anaconda, but the same error keeps happening.我试过重新安装 Anaconda,但同样的错误不断发生。 Can you please let me know what's stopping this from working as intended?你能告诉我是什么阻止了它按预期工作吗?

Thanks谢谢

Like the comments point out you are missing NodeJS.就像评论指出您缺少 NodeJS 一样。 Also the 1st five failed ports are because you have something running on your computer already.此外,第一个五个失败的端口是因为您的计算机上已经运行了一些东西。 Most likely they were jupyter lab servers you left running.它们很可能是您一直运行的 jupyter 实验室服务器。

So how to install NodeJS inside Anaconda?那么如何在 Anaconda 中安装 NodeJS?

conda install -c conda-forge nodejs

Then start Jupyter Lab again with: jupyter lab .然后再次启动 Jupyter Lab: jupyter lab

If it still cries about something, you can try to reinstall Jupyter Lab in your Anaconda installation:如果它仍然抱怨某些事情,您可以尝试在您的 Anaconda 安装中重新安装 Jupyter Lab:

conda install -c conda-forge jupyterlab

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM