简体   繁体   中英

Can't get Jupyter lab to work via Anaconda

I keep getting the same error message and 404 error :

[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. Can you please let me know what's stopping this from working as intended?

Thanks

Like the comments point out you are missing 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.

So how to install NodeJS inside Anaconda?

conda install -c conda-forge nodejs

Then start Jupyter Lab again with: jupyter lab .

If it still cries about something, you can try to reinstall Jupyter Lab in your Anaconda installation:

conda install -c conda-forge jupyterlab

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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