Windows Subsystem for Linux (WSL 2) and Jupyter Lab : How to open a Jupyter Notebook saved at the Linux file system?

后端 未结 4 2082
温柔的废话
温柔的废话 2021-01-03 12:08

I have a Jupyter lab installed on Windows. I installed Jupyter Lab on WSL Ubuntu. I can lunch Jupyter Lab from Linux terminal. This will open Jupyter Lab on Chrome browser

4条回答
  •  隐瞒了意图╮
    2021-01-03 12:42

    WSL 2 issues a dynamic IP address each time you launch WSL 2 -- see MSFT docs.

    Personally, I run a Python command within a subshell to print that IP:

    jupyter lab --ip $(python3 -c "import subprocess; subprocess.run(['hostname', '-I'], text=True).stdout")
    

    This works for me on Ubuntu 20.04 and Windows 10 build 19041.329.

    Note: You'll likely have to visit that IP address instead of localhost, plus the port through which you're running Jupyter, e.g. http://:8888 .

    To get my IP address via the CLI I use:

    ip addr | grep eth0 | grep inet
    

    I choose the first IP address available, typically using that address without the subnet mask, i.e. the forward slash + number.

提交回复
热议问题