首页 > 解决方案 > Jupyterlab: Directory keeps redirecting to where jupyter_notebook_config.py is

问题描述

I am using Windows Subsystem-Linux (WSL-Ubuntu) on Windows.
I have installed jupyterlab on WSL using Miniconda under a separate virtual environment for my own development.
I am using VSCode to access WSL through the built-in terminal.

However, it is a known issue that the current redirect URL does not work when being redirected from WSL.
To resolve the issue of the inability to redirect to nbserver html, I changed c.NotebookApp.notebook_dir = False.

However, it caused my jupyter notebook to always start my current directory (despite being in a different directory) to where jupyter_notebook_config.py is, even when I deleted it.
There is no way to somehow change this error until I reinstall it (including jupyter notebook and core) completely.

The second time it happened was also when I generated the config file to change the Browser value on the config to use the Chrome installed on my original system.

Using jupyter notebook or reinstalling in a different virtual environment also does not work..

Please help and Thanks in advance!!

How the directory looks like

标签: pythonjupyter-notebookwindows-subsystem-for-linuxjupyter-lab

解决方案


所以我发现了根本问题.. 有时当您关闭 VScode(WSL 扩展)上的代码或终端时,您的 jupyter 实验室/笔记本可能不会总是停止在 localhost 端口上运行,因此会导致您被重定向到默认值您的配置所在的位置。

即使您在终端上使用 Crtl-C 来阻止服务器运行,也会发生这种情况......

因此,只需运行:

jupyter notebook stop 8888

确保所有恶意服务器都可以使用 8888 端口,然后重新运行

jupyter lab / notebook

无需重新安装 jupyter 等!


推荐阅读