简体   繁体   中英

Cannot start jupyter server with WSL in DataSpell

It seems that DataSpell is trying to execute this command: C:\Windows\system32\wsl.exe --distribution Debian --exec /bin/sh -c "export LANGUAGE='' && export LC_ALL=en_US.UTF-8 && export LANG=en_US.UTF-8 && /usr/bin/python3 -m jupyter notebook --no-browser '--notebook-dir=/mnt/c/Users/Andy Zhou/Desktop/Year 2 stuff/GPT-2/code/SERI MATS IOI' --ip=172.22.246.59"

However, when I directly execute the part after --exec on WSL it works.

Adding some additional information regarding your problem, such as the error code that DataSpell likely returned to you, or whether or not htop shows a running Jupyter server, would make providing an accurate answer much easier.

As such, I believe your question could be read two ways, and I've provided an answer for each.

Server starts but will not connect

When DataSpell launches a local WSL-based Jupyter server it makes certain assumptions about how the connection should work, it also uses the LAN address for your WSL instance to attempt to connect. The default Jupyter config assumes a local connection, so DataSpell's connection via an external IP address is rejected immediately.

Steps to resolve this issue:

  1. In WSL run jupyter notebook --generate-config , it will print out the path of your new config file
  2. Vim into the new file and set the following values:
# Please note that the below values can be unsafe, consider changing these values to only allow your IP address to connect; alternatively you could require authentication to access the server.

## The IP address the notebook server will listen on.
c.NotebookApp.ip = '0.0.0.0'

## Set the Access-Control-Allow-Origin header 
c.NotebookApp.allow_origin = '*'

## Allow requests where the Host header doesn't point to a local server
c.NotebookApp.allow_remote_access = True
  1. Configure a WSL Python interpreter, detailed here: https://www.jetbrains.com/help/dataspell/using-wsl-as-a-remote-interpreter.html
  2. Change the Jupyter connection for your project to use the interpreter you just set up, detailed here: https://www.jetbrains.com/help/dataspell/using-wsl-as-a-remote-interpreter.html
  3. Run a cell in your notebook, a server should start up automatically and connect just fine.

A good resource on this is the following question: Why I can't access remote Jupyter Notebook server?

Sever does not start when using WSL

Unfortunately this is far more broad, and will almost certainly require more information to solve, but the following issues are highly likely causes:

Unfortunately without more information, or at least an error code, it isn't possible to give you a definitive answer; but hopefully this helped you in the right direction!

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