Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import module in subfolder when connected through remote #15777

Closed
1 of 2 tasks
guidocioni opened this issue Jun 17, 2024 · 9 comments
Closed
1 of 2 tasks

Cannot import module in subfolder when connected through remote #15777

guidocioni opened this issue Jun 17, 2024 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel)

Comments

@guidocioni
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

When trying to import a file located into a subdirectory of the folder where the notebook is running I get this error

Screenshot 2024-06-14 at 13 50 26

I know the import is supposed to be working because:

  1. when running the same code into a Python file everything is working as expected
  2. it used to work until a few weeks ago, so probably something has been introduced in the new version of either the Jupyter extension or Vscode.

I've been trying to narrow down the cause of this and I'm at a lost. It seems the PATH environmental variable is correctly sourced and the correct Python version is used. I tried to select multiple times the Python interpreter, restart kernel, restart server...

Curiously enough, if I connect to the Jupyter server that VsCode is itself starting (as shown in the Output:Jupyter tab), I'm indeed able to run the code without issues (VsCode has automatically forwarded the port 8888 locally from the remote host)

Screenshot 2024-06-17 at 19 03 23

This tells me that the Jupyter server spawned by VsCode is indeed correct, but the kernel that VsCode is spawning have something wrong. I tried to investigate a simple !printenv on both Jupyter running on localhost:8888 and Jupyter running in Vscode, and I've indeed seen some differences, but nothing stands out as problematic. Furthermore, I wouldn't really know how to tinker with the way VsCode starts the kernel (because I don't know where this is happening).

I can only reproduce this issue with a remote Machine running CentOS, I didn't have it on more recent machines running Ubuntu.

VS Code Version

1.90.1

Jupyter Extension Version

v2024.5.0

Jupyter logs

Visual Studio Code (1.90.1, ssh-remote, desktop)
Jupyter Extension Version: 2024.5.0.
Python Extension Version: 2024.8.1.
Pylance Extension Version: 2024.6.1.
Platform: linux (x64).
Workspace folder /var/models/wnetwork_new, Home = /home/cioni
19:07:08.576 [warn] Exception while attempting zmq : /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromq/prebuilds/linux-x64/node.napi.glibc.node)
19:07:08.577 [warn] Exception while attempting zmq (fallback) : /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromqold/prebuilds/linux-x64/node.napi.glibc.node)
19:07:09.185 [info] Attempting to start a server because of preload conditions ...
19:07:09.191 [debug] Start refreshing Kernel Picker (1718644029191)
19:07:11.451 [warn] No interpreter with path ~/miniconda3/envs/stations_new/bin/python found in Python API, will convert Uri path to string as Id ~/miniconda3/envs/stations_new/bin/python
19:07:11.454 [debug] Get Custom Env Variables, Class name = Bm, completed in 2264ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
19:07:11.454 [debug] Jupyter Paths /kernels: 
19:07:11.455 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
19:07:11.770 [debug] End refreshing Kernel Picker (1718644029191)
19:07:13.532 [debug] Start refreshing Kernel Picker (1718644033532)
19:07:13.639 [debug] Get Custom Env Variables, Class name = Bm, completed in 6ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
19:07:13.898 [debug] End refreshing Kernel Picker (1718644033532)
19:07:13.928 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher
19:07:13.929 [debug] start the kernel, options.disableUI=true for /var/models/wnetwork_new/scripts/test.ipynb
19:07:13.994 [debug] Controller selection change completed
19:07:14.000 [info] Starting Kernel (Python Path: ~/miniconda3/envs/stations_new/bin/python, Conda, 3.11.7) for '/var/models/wnetwork_new/scripts/test.ipynb' (disableUI=true)
19:07:15.291 [debug] Got env vars from Python Ext in 1658ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 83.
19:07:15.293 [debug] Getting activated env variables, Class name = Pp, completed in 1660ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
19:07:15.309 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import jupyter;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
19:07:15.321 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import notebook;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
19:07:15.332 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m pip list
19:07:15.370 [debug] Checking if product is installed, Class name = ND, completed in 1817ms, has a truthy return value, Arg 1: 18, Arg 2: undefined, Return Value: true
19:07:15.378 [debug] Checking if product is installed, Class name = ND, completed in 1823ms, has a truthy return value, Arg 1: 20, Arg 2: undefined, Return Value: true
19:07:15.388 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m jupyter kernelspec --version
19:07:15.689 [debug] Interpreter for Pylance for Notebook URI "/var/models/wnetwork_new/scripts/test.ipynb" is ~/miniconda3/envs/stations_new/bin/python
19:07:16.010 [debug] Starting notebook server.
19:07:16.011 [debug] Launching server
19:07:16.014 [info] Starting Jupyter Server
19:07:16.017 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
19:07:16.018 [debug] Got env vars from Python Ext in 2ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 83.
19:07:16.019 [debug] Getting activated env variables, Class name = Pp, completed in 3ms, has a truthy return value, Arg 1: undefined, Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
19:07:16.026 [debug] Generating custom default config at /tmp/09c5957b-dfbc-419b-9c46-0c9915c96e7f/jupyter_notebook_config.py
19:07:16.027 [debug] Starting Jupyter from ~/miniconda3/envs/stations_new/bin/python with arguments --no-browser --notebook-dir="/var/models/wnetwork_new" --config=/tmp/09c5957b-dfbc-419b-9c46-0c9915c96e7f/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
19:07:16.046 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m jupyter notebook --no-browser --notebook-dir="/var/models/wnetwork_new" --config=/tmp/09c5957b-dfbc-419b-9c46-0c9915c96e7f/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
19:07:16.047 [debug] Waiting for Jupyter Notebook
19:07:18.943 [debug] [I 2024-06-17 17:07:18.941 ServerApp] jupyter_lsp | extension was successfully linked.
19:07:18.952 [debug] [I 2024-06-17 17:07:18.951 ServerApp] jupyter_server_terminals | extension was successfully linked.
19:07:18.956 [debug] [W 2024-06-17 17:07:18.955 LabApp] 'iopub_data_rate_limit' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
19:07:18.968 [debug] [W 2024-06-17 17:07:18.967 ServerApp] ServerApp.iopub_data_rate_limit config is deprecated in 2.0. Use ZMQChannelsWebsocketConnection.iopub_data_rate_limit.
19:07:18.969 [debug] [I 2024-06-17 17:07:18.967 ServerApp] jupyterlab | extension was successfully linked.
19:07:18.979 [debug] [I 2024-06-17 17:07:18.978 ServerApp] notebook | extension was successfully linked.
19:07:19.583 [debug] [I 2024-06-17 17:07:19.582 ServerApp] notebook_shim | extension was successfully linked.
19:07:19.610 [debug] [I 2024-06-17 17:07:19.609 ServerApp] notebook_shim | extension was successfully loaded.
19:07:19.620 [debug] [I 2024-06-17 17:07:19.618 ServerApp] jupyter_lsp | extension was successfully loaded.
19:07:19.629 [debug] [I 2024-06-17 17:07:19.628 ServerApp] jupyter_server_terminals | extension was successfully loaded.
19:07:19.642 [debug] [I 2024-06-17 17:07:19.641 LabApp] JupyterLab extension loaded from /home/~/miniconda3/envs/stations_new/lib/python3.11/site-packages/jupyterlab
19:07:19.647 [debug] [I 2024-06-17 17:07:19.646 LabApp] JupyterLab application directory is /home/~/miniconda3/envs/stations_new/share/jupyter/lab
19:07:19.648 [debug] [I 2024-06-17 17:07:19.647 LabApp] Extension Manager is 'pypi'.
19:07:19.722 [debug] [I 2024-06-17 17:07:19.721 ServerApp] jupyterlab | extension was successfully loaded.
19:07:19.734 [debug] [I 2024-06-17 17:07:19.732 ServerApp] notebook | extension was successfully loaded.
19:07:19.739 [debug] [I 2024-06-17 17:07:19.738 ServerApp] Serving notebooks from local directory: /var/models/wnetwork_new
19:07:19.741 [debug] [I 2024-06-17 17:07:19.741 ServerApp] Jupyter Server 2.13.0 is running at:
19:07:19.743 [debug] [I 2024-06-17 17:07:19.742 ServerApp] http://localhost:8888/tree?token=2c0cfb94c6732ca87677ffcda15f1c6857325d69e42a9461
19:07:19.790 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
19:07:19.798 [debug] [I 2024-06-17 17:07:19.758 ServerApp]     http://127.0.0.1:8888/tree?token=2c0cfb94c6732ca87677ffcda15f1c6857325d69e42a9461
    [I 2024-06-17 17:07:19.758 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    [C 2024-06-17 17:07:19.767 ServerApp]
    To access the server, open this file in a browser:
    file:///home/~/.local/share/jupyter/runtime/jpserver-22643-open.html
    Or copy and paste one of these URLs:
    http://localhost:8888/tree?token=2c0cfb94c6732ca87677ffcda15f1c6857325d69e42a9461
    http://127.0.0.1:8888/tree?token=2c0cfb94c6732ca87677ffcda15f1c6857325d69e42a9461
19:07:19.855 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
19:07:19.947 [debug] [I 2024-06-17 17:07:19.896 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
19:07:20.001 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
19:07:20.425 [debug] Handle Execution of Cells 58 for /var/models/wnetwork_new/scripts/test.ipynb
19:07:21.389 [debug] Check if a kernel .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher is usable
19:07:21.391 [info] Check & install missing Kernel dependencies for ~/miniconda3/envs/stations_new/bin/python, ui.disabled=false for resource '/var/models/wnetwork_new/scripts/test.ipynb'
19:07:21.423 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
19:07:22.131 [debug] Checking if product is installed, Class name = ND, completed in 740ms, has a truthy return value, Arg 1: 19, Arg 2: undefined, Return Value: true
19:07:22.132 [debug] Are Dependencies Installed, Class name = dd, completed in 741ms, has a truthy return value, Arg 1: "~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher", Arg 2: {"a":false,"b":{"w":1,"u":{"i":-1,"end":0},"t":[{"id":1603}]}}, Arg 3: true, Return Value: true
19:07:22.133 [debug] Install Missing Dependencies, Class name = dd, completed in 743ms, has a falsy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"/var/models/wnetwork_new/scripts/test.ipynb","external":"file:///var/models/wnetwork_new/scripts/test.ipynb","path":"/var/models/wnetwork_new/scripts/test.ipynb","scheme":"file"},"kernelConnection":{"id":".jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher","kernelSpec":{"specFile":"/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/temp/jupyter/kernels/python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c/kernel.json","interpreterPath":"/home/~/miniconda3/envs/stations_new/bin/python","isRegisteredByVSC":"registeredByNewVersionOfExt","name":"python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","executable":"python","display_name":"stations_new","metadata":{"interpreter":{"path":"/home/~/miniconda3/envs/stations_new/bin/python"}},"env":{}},"interpreter":{"id":"/home/~/miniconda3/envs/stations_new/bin/python","path":"/home/~/miniconda3/envs/stations_new/bin/python"},"kind":"startUsingPythonInterpreter"},"ui":{"_event":{"w":4,"u":{"i":4,"end":4},"t":[{"id":1302},{"id":1316},{"id":1330},{"id":1331}]},"_disableUI":false},"token":{"a":false,"b":{"w":1,"u":{"i":-1,"end":0},"t":[{"id":1603}]}},"ignoreCache":true,"cannotChangeKernels":false}, Return Value: 0
19:07:22.145 [debug] Updating Kernel Environment for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher for interpreter /home/~/miniconda3/envs/stations_new/bin/python
19:07:22.161 [debug] Python KernelSpec argv[0] updated for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher from '/home/~/miniconda3/envs/stations_new/bin/python' to '~/miniconda3/envs/stations_new/bin/python'
19:07:22.164 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "RunPythonCode"
19:07:22.166 [debug] Got env vars from Python Ext in 2ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 83.
19:07:22.166 [debug] Getting activated env variables, Class name = Pp, completed in 3ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
19:07:22.286 [debug] Updated kernel spec for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher with environment variables for ~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/temp/jupyter/kernels/python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c/kernel.json
19:07:22.470 [debug] [I 2024-06-17 17:07:22.469 ServerApp] Kernel started: 7e075c4c-98c4-4787-a803-29a8ca4440b6
19:07:22.499 [info] http://localhost:8888: Kernel started: 7e075c4c-98c4-4787-a803-29a8ca4440b6
19:07:24.122 [debug] [I 2024-06-17 17:07:24.110 ServerApp] Connecting to kernel 7e075c4c-98c4-4787-a803-29a8ca4440b6.
19:07:24.275 [info] Started session for kernel startUsingPythonInterpreter:.jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher
19:07:24.424 [debug] Requesting Kernel info
19:07:24.432 [info] Kernel successfully started
19:07:24.436 [debug] getDataDirsImpl, Class name = jr (started execution), Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python"
19:07:24.437 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
19:07:24.438 [debug] Jupyter Paths : 
19:07:24.453 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/printJupyterDataDir.py
19:07:24.489 [debug] Kernel acknowledged execution of cell 58 @ 1718644044487
19:07:24.492 [debug] getDataDirsImpl, Class name = jr, completed in 55ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Return Value: <Uri:/home/~/.local/share/jupyter>, <Uri:/home/~/miniconda3/envs/stations_new/share/jupyter>, <Uri:/usr/local/share/jupyter>, <Uri:/usr/share/jupyter>
19:07:24.873 [warn] Cell completed with errors [hd [Error]: No module named 'lib'
	at r.execute (/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/extension.node.js:307:4958)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)] {
  ename: 'ModuleNotFoundError',
  evalue: "No module named 'lib'",
  traceback: [
    '\x1B[0;31m---------------------------------------------------------------------------\x1B[0m',
    '\x1B[0;31mModuleNotFoundError\x1B[0m                       Traceback (most recent call last)',
    'Cell \x1B[0;32mIn[1], line 1\x1B[0m\n' +
      '\x1B[0;32m----> 1\x1B[0m \x1B[38;5;28;01mfrom\x1B[39;00m \x1B[38;5;21;01mlib\x1B[39;00m\x1B[38;5;21;01m.\x1B[39;00m\x1B[38;5;21;01mdata_utils\x1B[39;00m \x1B[38;5;28;01mimport\x1B[39;00m get_daily\n',
    "\x1B[0;31mModuleNotFoundError\x1B[0m: No module named 'lib'"
  ]
}

Coding Language and Runtime Version

Python 3.11

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

@guidocioni guidocioni added the bug Issue identified by VS Code Team member as probable bug label Jun 17, 2024
@krzim
Copy link

krzim commented Jun 23, 2024

I'm also seeing this issue on Windows 11 running VSCode connected to a dev container. I had to roll back to v2024.3.1 as both v2024.4.0 and v2024.5.0 would not let me import local files.

@guidocioni
Copy link
Author

I'm also seeing this issue on Windows 11 running VSCode connected to a dev container. I had to roll back to v2024.3.1 as both v2024.4.0 and v2024.5.0 would not let me import local files.

Did you manage to understand what is causing it? I have other projects on the same remote machine where the local import does not fail. Plus, I don't have the issue on other machines...
I really cannot narrow it down, but I have the feeling vscode is unsetting something when starting the kernel

@krzim
Copy link

krzim commented Jun 24, 2024

I'll be honest, I didn't do much more digging once I unblocked myself. I'm happy to debug if needed though.

@guidocioni
Copy link
Author

Are the devs ever going to address this? Am I really the only one experiencing this issue?
I tried to dig into the issue and today at some point when I started it would let me run the import without issue. Here is the log

Visual Studio Code (1.90.2, ssh-remote, desktop)
Jupyter Extension Version: 2024.5.0.
Python Extension Version: 2024.8.1.
Pylance Extension Version: 2024.6.1.
Platform: linux (x64).
Workspace folder /var/models/wnetwork_new, Home = /home/cioni
16:17:26.633 [warn] Exception while attempting zmq : /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromq/prebuilds/linux-x64/node.napi.glibc.node)
16:17:26.634 [warn] Exception while attempting zmq (fallback) : /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromqold/prebuilds/linux-x64/node.napi.glibc.node)
16:17:27.023 [debug] Start refreshing Kernel Picker (1719929847022)
16:17:29.902 [warn] No interpreter with path ~/miniconda3/envs/stations_new/bin/python found in Python API, will convert Uri path to string as Id ~/miniconda3/envs/stations_new/bin/python
16:17:29.904 [debug] Get Custom Env Variables, Class name = Bm, completed in 2882ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
16:17:29.905 [debug] Jupyter Paths /kernels: 
16:17:29.906 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
16:17:30.119 [debug] End refreshing Kernel Picker (1719929847022)
16:17:34.968 [debug] Start refreshing Kernel Picker (1719929854968)
16:17:34.986 [debug] End refreshing Kernel Picker (1719929854968)
16:17:36.627 [debug] Start refreshing Kernel Picker (1719929856627)
16:17:38.238 [debug] End refreshing Kernel Picker (1719929856627)
16:17:41.241 [debug] Start refreshing Kernel Picker (1719929861241)
16:17:41.248 [debug] End refreshing Kernel Picker (1719929861241)
16:17:41.254 [debug] Start refreshing Kernel Picker (1719929861254)
16:17:41.268 [debug] End refreshing Kernel Picker (1719929861254)
16:17:43.229 [debug] Start refreshing Kernel Picker (1719929863229)
16:17:43.236 [debug] End refreshing Kernel Picker (1719929863229)
16:17:43.248 [debug] Start refreshing Kernel Picker (1719929863248)
16:17:43.265 [debug] End refreshing Kernel Picker (1719929863248)
16:17:43.272 [debug] Start refreshing Kernel Picker (1719929863272)
16:17:43.353 [debug] End refreshing Kernel Picker (1719929863272)
16:17:43.734 [debug] Start refreshing Kernel Picker (1719929863734)
16:17:43.743 [debug] End refreshing Kernel Picker (1719929863734)
16:17:43.796 [debug] Start refreshing Kernel Picker (1719929863796)
16:17:43.943 [debug] Get Custom Env Variables, Class name = Bm, completed in 5ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
16:17:45.603 [debug] Got env vars from Python Ext in 1665ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:17:45.605 [debug] Getting activated env variables, Class name = Pp, completed in 1668ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:17:45.619 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import jupyter;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
16:17:45.625 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import notebook;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
16:17:45.710 [debug] Checking if product is installed, Class name = ND, completed in 1896ms, has a truthy return value, Arg 1: 18, Arg 2: undefined, Return Value: true
16:17:45.932 [debug] Checking if product is installed, Class name = ND, completed in 2116ms, has a truthy return value, Arg 1: 20, Arg 2: undefined, Return Value: true
16:17:45.940 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m jupyter kernelspec --version
16:17:46.180 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher
16:17:46.181 [debug] start the kernel, options.disableUI=true for /var/models/wnetwork_new/scripts/test.ipynb
16:17:46.270 [debug] Controller selection change completed
16:17:46.277 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m pip list
16:17:46.278 [info] Starting Kernel (Python Path: ~/miniconda3/envs/stations_new/bin/python, Conda, 3.11.7) for '/var/models/wnetwork_new/scripts/test.ipynb' (disableUI=true)
16:17:46.430 [debug] End refreshing Kernel Picker (1719929863796)
16:17:47.325 [debug] Interpreter for Pylance for Notebook URI "/var/models/wnetwork_new/scripts/test.ipynb" is ~/miniconda3/envs/stations_new/bin/python
16:17:48.890 [debug] Start refreshing Kernel Picker (1719929868890)
16:17:48.891 [debug] End refreshing Kernel Picker (1719929868890)
16:17:54.141 [debug] Starting notebook server.
16:17:54.141 [debug] Launching server
16:17:54.142 [debug] Get Custom Env Variables, Class name = Bm, completed in 0ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
16:17:54.143 [debug] Got env vars from Python Ext in 1ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:17:54.144 [debug] Getting activated env variables, Class name = Pp, completed in 2ms, has a truthy return value, Arg 1: undefined, Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:17:54.149 [info] Starting Jupyter Server
16:17:54.152 [debug] Generating custom default config at /tmp/c9b72804-f7d5-4f42-acfc-9001df1cb7cc/jupyter_notebook_config.py
16:17:54.153 [debug] Starting Jupyter from ~/miniconda3/envs/stations_new/bin/python with arguments --no-browser --notebook-dir="/var/models/wnetwork_new/scripts" --config=/tmp/c9b72804-f7d5-4f42-acfc-9001df1cb7cc/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
16:17:54.155 [debug] Get Custom Env Variables, Class name = Bm, completed in 0ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
16:17:54.155 [debug] Got env vars from Python Ext in 1ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:17:54.156 [debug] Getting activated env variables, Class name = Pp, completed in 2ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:17:54.166 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m jupyter notebook --no-browser --notebook-dir="/var/models/wnetwork_new/scripts" --config=/tmp/c9b72804-f7d5-4f42-acfc-9001df1cb7cc/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
16:17:54.166 [debug] Waiting for Jupyter Notebook
16:18:07.643 [debug] [I 2024-07-02 14:18:07.635 ServerApp] jupyter_lsp | extension was successfully linked.
16:18:07.645 [debug] [I 2024-07-02 14:18:07.641 ServerApp] jupyter_server_terminals | extension was successfully linked.
    [W 2024-07-02 14:18:07.644 LabApp] 'iopub_data_rate_limit' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
16:18:07.651 [debug] [W 2024-07-02 14:18:07.651 ServerApp] ServerApp.iopub_data_rate_limit config is deprecated in 2.0. Use ZMQChannelsWebsocketConnection.iopub_data_rate_limit.
16:18:07.651 [debug] [I 2024-07-02 14:18:07.651 ServerApp] jupyterlab | extension was successfully linked.
16:18:07.658 [debug] [I 2024-07-02 14:18:07.657 ServerApp] notebook | extension was successfully linked.
16:18:09.321 [debug] Handle Execution of Cells 57 for /var/models/wnetwork_new/scripts/test.ipynb
16:18:12.839 [debug] [I 2024-07-02 14:18:12.837 ServerApp] notebook_shim | extension was successfully linked.
16:18:13.088 [debug] [I 2024-07-02 14:18:13.088 ServerApp] notebook_shim | extension was successfully loaded.
16:18:13.094 [debug] [I 2024-07-02 14:18:13.094 ServerApp] jupyter_lsp | extension was successfully loaded.
16:18:13.097 [debug] [I 2024-07-02 14:18:13.096 ServerApp] jupyter_server_terminals | extension was successfully loaded.
16:18:13.169 [debug] [I 2024-07-02 14:18:13.168 LabApp] JupyterLab extension loaded from /home/~/miniconda3/envs/stations_new/lib/python3.11/site-packages/jupyterlab
16:18:13.170 [debug] [I 2024-07-02 14:18:13.170 LabApp] JupyterLab application directory is /home/~/miniconda3/envs/stations_new/share/jupyter/lab
16:18:13.172 [debug] [I 2024-07-02 14:18:13.172 LabApp] Extension Manager is 'pypi'.
16:18:13.200 [debug] [I 2024-07-02 14:18:13.199 ServerApp] jupyterlab | extension was successfully loaded.
16:18:13.207 [debug] [I 2024-07-02 14:18:13.206 ServerApp] notebook | extension was successfully loaded.
16:18:13.208 [debug] [I 2024-07-02 14:18:13.208 ServerApp] The port 8888 is already in use, trying another port.
16:18:13.210 [debug] [I 2024-07-02 14:18:13.210 ServerApp] Serving notebooks from local directory: /var/models/wnetwork_new/scripts
16:18:13.210 [debug] [I 2024-07-02 14:18:13.210 ServerApp] Jupyter Server 2.13.0 is running at:
16:18:13.211 [debug] [I 2024-07-02 14:18:13.210 ServerApp] http://localhost:8889/tree?token=01dac943b1eaebb5d9eb31e06ba16f498f76279ec81517a1
16:18:13.225 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:18:13.226 [debug] [I 2024-07-02 14:18:13.212 ServerApp]     http://127.0.0.1:8889/tree?token=01dac943b1eaebb5d9eb31e06ba16f498f76279ec81517a1
    [I 2024-07-02 14:18:13.212 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
16:18:13.235 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:18:13.289 [debug] [C 2024-07-02 14:18:13.289 ServerApp]
    To access the server, open this file in a browser:
    file:///home/~/.local/share/jupyter/runtime/jpserver-29142-open.html
    Or copy and paste one of these URLs:
    http://localhost:8889/tree?token=01dac943b1eaebb5d9eb31e06ba16f498f76279ec81517a1
    http://127.0.0.1:8889/tree?token=01dac943b1eaebb5d9eb31e06ba16f498f76279ec81517a1
16:18:13.297 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:18:13.334 [debug] [I 2024-07-02 14:18:13.334 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
16:18:13.343 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:18:14.209 [debug] Check if a kernel .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher is usable
16:18:14.210 [info] Check & install missing Kernel dependencies for ~/miniconda3/envs/stations_new/bin/python, ui.disabled=false for resource '/var/models/wnetwork_new/scripts/test.ipynb'
16:18:14.216 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
16:18:14.621 [debug] Checking if product is installed, Class name = ND, completed in 410ms, has a truthy return value, Arg 1: 19, Arg 2: undefined, Return Value: true
16:18:14.622 [debug] Are Dependencies Installed, Class name = dd, completed in 412ms, has a truthy return value, Arg 1: "~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher", Arg 2: {"a":false,"b":{"w":1,"u":{"i":-1,"end":0},"t":[{"id":2508}]}}, Arg 3: true, Return Value: true
16:18:14.622 [debug] Install Missing Dependencies, Class name = dd, completed in 412ms, has a falsy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"/var/models/wnetwork_new/scripts/test.ipynb","external":"file:///var/models/wnetwork_new/scripts/test.ipynb","path":"/var/models/wnetwork_new/scripts/test.ipynb","scheme":"file"},"kernelConnection":{"id":".jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher","kernelSpec":{"specFile":"/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/temp/jupyter/kernels/python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c/kernel.json","interpreterPath":"/home/~/miniconda3/envs/stations_new/bin/python","isRegisteredByVSC":"registeredByNewVersionOfExt","name":"python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","executable":"python","display_name":"stations_new","metadata":{"interpreter":{"path":"/home/~/miniconda3/envs/stations_new/bin/python"}},"env":{}},"interpreter":{"id":"/home/~/miniconda3/envs/stations_new/bin/python","path":"/home/~/miniconda3/envs/stations_new/bin/python"},"kind":"startUsingPythonInterpreter"},"ui":{"_event":{"w":4,"u":{"i":4,"end":4},"t":[{"id":1313},{"id":1327},{"id":1341},{"id":1342}]},"_disableUI":false},"token":{"a":false,"b":{"w":1,"u":{"i":-1,"end":0},"t":[{"id":2508}]}},"ignoreCache":true,"cannotChangeKernels":false}, Return Value: 0
16:18:14.627 [debug] Updating Kernel Environment for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher for interpreter /home/~/miniconda3/envs/stations_new/bin/python
16:18:14.633 [debug] Python KernelSpec argv[0] updated for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher from '/home/~/miniconda3/envs/stations_new/bin/python' to '~/miniconda3/envs/stations_new/bin/python'
16:18:14.636 [debug] Get Custom Env Variables, Class name = Bm, completed in 0ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "RunPythonCode"
16:18:14.637 [debug] Got env vars from Python Ext in 1ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:18:14.638 [debug] Getting activated env variables, Class name = Pp, completed in 3ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:18:14.641 [debug] Updated kernel spec for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher with environment variables for ~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/temp/jupyter/kernels/python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c/kernel.json
16:18:14.811 [debug] [I 2024-07-02 14:18:14.811 ServerApp] Kernel started: e04b9649-335b-456a-a43e-9bf4a842af5b
16:18:14.828 [info] http://localhost:8889: Kernel started: e04b9649-335b-456a-a43e-9bf4a842af5b
16:18:16.312 [info] Started session for kernel startUsingPythonInterpreter:.jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher
16:18:16.318 [debug] [I 2024-07-02 14:18:16.280 ServerApp] Connecting to kernel e04b9649-335b-456a-a43e-9bf4a842af5b.
16:18:16.473 [debug] Requesting Kernel info
16:18:16.480 [info] Kernel successfully started
16:18:16.483 [debug] getDataDirsImpl, Class name = jr (started execution), Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python"
16:18:16.484 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
16:18:16.485 [debug] Jupyter Paths : 
16:18:16.500 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/printJupyterDataDir.py
16:18:16.530 [debug] getDataDirsImpl, Class name = jr, completed in 48ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Return Value: <Uri:/home/~/.local/share/jupyter>, <Uri:/home/~/miniconda3/envs/stations_new/share/jupyter>, <Uri:/usr/local/share/jupyter>, <Uri:/usr/share/jupyter>
16:18:16.535 [debug] Kernel acknowledged execution of cell 57 @ 1719929896534
16:19:00.617 [debug] Handle Execution of Cells 58 for /var/models/wnetwork_new/scripts/test.ipynb
16:19:00.645 [debug] Kernel acknowledged execution of cell 58 @ 1719929940645

However, then I tried to disconnect and connect again and I got the same issue

Visual Studio Code (1.90.2, ssh-remote, desktop)
Jupyter Extension Version: 2024.5.0.
Python Extension Version: 2024.8.1.
Pylance Extension Version: 2024.6.1.
Platform: linux (x64).
Workspace folder /var/models/wnetwork_new, Home = /home/cioni
16:25:44.309 [warn] Exception while attempting zmq : /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromq/prebuilds/linux-x64/node.napi.glibc.node)
16:25:44.310 [warn] Exception while attempting zmq (fallback) : /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromqold/prebuilds/linux-x64/node.napi.glibc.node)
16:25:44.687 [info] Attempting to start a server because of preload conditions ...
16:25:44.691 [debug] Start refreshing Kernel Picker (1719930344691)
16:25:46.627 [debug] Get Custom Env Variables, Class name = Bm, completed in 1936ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
16:25:46.627 [debug] Jupyter Paths /kernels: 
16:25:46.628 [debug] Kernel Spec Root Paths, /usr/share/jupyter/kernels, /usr/local/share/jupyter/kernels, ~/.local/share/jupyter/kernels
16:25:46.926 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
16:25:47.117 [debug] KernelProvider switched kernel to id = .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher
16:25:47.119 [debug] start the kernel, options.disableUI=true for /var/models/wnetwork_new/scripts/test.ipynb
16:25:47.211 [debug] Controller selection change completed
16:25:47.228 [info] Starting Kernel (Python Path: ~/miniconda3/envs/stations_new/bin/python, Conda, 3.11.7) for '/var/models/wnetwork_new/scripts/test.ipynb' (disableUI=true)
16:25:47.928 [debug] End refreshing Kernel Picker (1719930344691)
16:25:49.575 [debug] Interpreter for Pylance for Notebook URI "/var/models/wnetwork_new/scripts/test.ipynb" is ~/miniconda3/envs/stations_new/bin/python
16:25:50.691 [debug] Got env vars from Python Ext in 3765ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:25:50.691 [debug] Getting activated env variables, Class name = Pp, completed in 3767ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:25:50.702 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import jupyter;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
16:25:50.711 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import notebook;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
16:25:50.727 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m pip list
16:25:50.747 [debug] Checking if product is installed, Class name = ND, completed in 3829ms, has a truthy return value, Arg 1: 18, Arg 2: undefined, Return Value: true
16:25:50.759 [debug] Checking if product is installed, Class name = ND, completed in 3839ms, has a truthy return value, Arg 1: 20, Arg 2: undefined, Return Value: true
16:25:50.772 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m jupyter kernelspec --version
16:25:51.281 [debug] Starting notebook server.
16:25:51.282 [debug] Launching server
16:25:51.284 [info] Starting Jupyter Server
16:25:51.287 [debug] Get Custom Env Variables, Class name = Bm, completed in 0ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new", Arg 2: "RunPythonCode"
16:25:51.287 [debug] Got env vars from Python Ext in 2ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:25:51.288 [debug] Getting activated env variables, Class name = Pp, completed in 3ms, has a truthy return value, Arg 1: undefined, Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:25:51.294 [debug] Generating custom default config at /tmp/732eee67-c9b5-4151-a8e9-0e78d79e3d44/jupyter_notebook_config.py
16:25:51.295 [debug] Starting Jupyter from ~/miniconda3/envs/stations_new/bin/python with arguments --no-browser --notebook-dir="/var/models/wnetwork_new" --config=/tmp/732eee67-c9b5-4151-a8e9-0e78d79e3d44/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
16:25:51.310 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -m jupyter notebook --no-browser --notebook-dir="/var/models/wnetwork_new" --config=/tmp/732eee67-c9b5-4151-a8e9-0e78d79e3d44/jupyter_notebook_config.py --NotebookApp.iopub_data_rate_limit=10000000000.0
16:25:51.311 [debug] Waiting for Jupyter Notebook
16:25:53.800 [debug] [I 2024-07-02 14:25:53.800 ServerApp] jupyter_lsp | extension was successfully linked.
16:25:53.809 [debug] [I 2024-07-02 14:25:53.809 ServerApp] jupyter_server_terminals | extension was successfully linked.
16:25:53.821 [debug] [W 2024-07-02 14:25:53.821 LabApp] 'iopub_data_rate_limit' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
16:25:53.831 [debug] [W 2024-07-02 14:25:53.831 ServerApp] ServerApp.iopub_data_rate_limit config is deprecated in 2.0. Use ZMQChannelsWebsocketConnection.iopub_data_rate_limit.
16:25:53.832 [debug] [I 2024-07-02 14:25:53.831 ServerApp] jupyterlab | extension was successfully linked.
16:25:53.840 [debug] [I 2024-07-02 14:25:53.839 ServerApp] notebook | extension was successfully linked.
16:25:54.217 [debug] [I 2024-07-02 14:25:54.215 ServerApp] notebook_shim | extension was successfully linked.
16:25:54.270 [debug] [I 2024-07-02 14:25:54.240 ServerApp] notebook_shim | extension was successfully loaded.
    [I 2024-07-02 14:25:54.245 ServerApp] jupyter_lsp | extension was successfully loaded.
    [I 2024-07-02 14:25:54.247 ServerApp] jupyter_server_terminals | extension was successfully loaded.
    [I 2024-07-02 14:25:54.249 LabApp] JupyterLab extension loaded from /home/~/miniconda3/envs/stations_new/lib/python3.11/site-packages/jupyterlab
    [I 2024-07-02 14:25:54.249 LabApp] JupyterLab application directory is /home/~/miniconda3/envs/stations_new/share/jupyter/lab
    [I 2024-07-02 14:25:54.250 LabApp] Extension Manager is 'pypi'.
16:25:54.277 [debug] [I 2024-07-02 14:25:54.277 ServerApp] jupyterlab | extension was successfully loaded.
16:25:54.284 [debug] [I 2024-07-02 14:25:54.283 ServerApp] notebook | extension was successfully loaded.
16:25:54.285 [debug] [I 2024-07-02 14:25:54.285 ServerApp] Serving notebooks from local directory: /var/models/wnetwork_new
16:25:54.285 [debug] [I 2024-07-02 14:25:54.285 ServerApp] Jupyter Server 2.13.0 is running at:
    [I 2024-07-02 14:25:54.285 ServerApp] http://localhost:8888/tree?token=7e23e28e39e051b54850cc8ccfb03957ad54fab70d751074
    [I 2024-07-02 14:25:54.285 ServerApp]     http://127.0.0.1:8888/tree?token=7e23e28e39e051b54850cc8ccfb03957ad54fab70d751074
    [I 2024-07-02 14:25:54.285 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
16:25:54.302 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:25:54.303 [debug] [C 2024-07-02 14:25:54.289 ServerApp]
    To access the server, open this file in a browser:
    file:///home/~/.local/share/jupyter/runtime/jpserver-32803-open.html
    Or copy and paste one of these URLs:
    http://localhost:8888/tree?token=7e23e28e39e051b54850cc8ccfb03957ad54fab70d751074
    http://127.0.0.1:8888/tree?token=7e23e28e39e051b54850cc8ccfb03957ad54fab70d751074
16:25:54.319 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:25:54.329 [debug] [I 2024-07-02 14:25:54.328 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
16:25:54.351 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/vscode_datascience_helpers/getServerInfo.py
16:25:55.361 [debug] Check if a kernel .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher is usable
16:25:55.362 [info] Check & install missing Kernel dependencies for ~/miniconda3/envs/stations_new/bin/python, ui.disabled=true for resource '/var/models/wnetwork_new/scripts/test.ipynb'
16:25:55.372 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python -c "import ipykernel;print('6af208d0-cb9c-427f-b937-ff563e17efdf')"
16:25:55.697 [debug] Checking if product is installed, Class name = ND, completed in 334ms, has a truthy return value, Arg 1: 19, Arg 2: undefined, Return Value: true
16:25:55.697 [debug] Are Dependencies Installed, Class name = dd, completed in 335ms, has a truthy return value, Arg 1: "~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher", Arg 2: {"a":false,"b":{"w":1,"u":{"i":-1,"end":0},"t":[{"id":1483}]}}, Arg 3: true, Return Value: true
16:25:55.698 [debug] Install Missing Dependencies, Class name = dd, completed in 336ms, has a falsy return value, Arg 1: {"resource":{"$mid":1,"fsPath":"/var/models/wnetwork_new/scripts/test.ipynb","external":"file:///var/models/wnetwork_new/scripts/test.ipynb","path":"/var/models/wnetwork_new/scripts/test.ipynb","scheme":"file"},"kernelConnection":{"id":".jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher","kernelSpec":{"specFile":"/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/temp/jupyter/kernels/python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c/kernel.json","interpreterPath":"/home/~/miniconda3/envs/stations_new/bin/python","isRegisteredByVSC":"registeredByNewVersionOfExt","name":"python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c","argv":["python","-m","ipykernel_launcher","-f","{connection_file}"],"language":"python","executable":"python","display_name":"stations_new","metadata":{"interpreter":{"path":"/home/~/miniconda3/envs/stations_new/bin/python"}},"env":{}},"interpreter":{"id":"/home/~/miniconda3/envs/stations_new/bin/python","path":"/home/~/miniconda3/envs/stations_new/bin/python"},"kind":"startUsingPythonInterpreter"},"ui":{"_event":{"w":4,"u":{"i":-1,"end":0},"t":[{"id":1164},{"id":1178},{"id":1195},{"id":1196}]},"_disableUI":true},"token":{"a":false,"b":{"w":1,"u":{"i":-1,"end":0},"t":[{"id":1483}]}},"ignoreCache":true,"cannotChangeKernels":false}, Return Value: 0
16:25:55.701 [debug] Updating Kernel Environment for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher for interpreter /home/~/miniconda3/envs/stations_new/bin/python
16:25:55.703 [debug] Python KernelSpec argv[0] updated for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher from '/home/~/miniconda3/envs/stations_new/bin/python' to '~/miniconda3/envs/stations_new/bin/python'
16:25:55.706 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "RunPythonCode"
16:25:55.707 [debug] Got env vars from Python Ext in 2ms for ~/miniconda3/envs/stations_new/bin/python, with env var count 82.
16:25:55.707 [debug] Getting activated env variables, Class name = Pp, completed in 2ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Arg 3: undefined
16:25:55.709 [debug] Updated kernel spec for .jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher with environment variables for ~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/temp/jupyter/kernels/python3117jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c/kernel.json
16:25:55.794 [debug] [I 2024-07-02 14:25:55.794 ServerApp] Kernel started: 8d952045-ffef-402a-b581-863ab76dfc8f
16:25:55.815 [info] http://localhost:8888: Kernel started: 8d952045-ffef-402a-b581-863ab76dfc8f
16:25:56.751 [debug] [I 2024-07-02 14:25:56.746 ServerApp] Connecting to kernel 8d952045-ffef-402a-b581-863ab76dfc8f.
16:25:56.801 [info] Started session for kernel startUsingPythonInterpreter:.jvsc74a57bd0fdb8be4ba885e374374c2797cae172193a724b22d3e0bf323b23803166b5f94c./home/~/miniconda3/envs/stations_new/python./home/~/miniconda3/envs/stations_new/python.-m#ipykernel_launcher
16:25:56.972 [debug] Requesting Kernel info
16:25:56.978 [info] Kernel successfully started
16:25:56.981 [debug] getDataDirsImpl, Class name = jr (started execution), Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python"
16:25:56.982 [debug] Get Custom Env Variables, Class name = Bm, completed in 1ms, has a truthy return value, Arg 1: undefined, Arg 2: "RunPythonCode"
16:25:56.982 [debug] Jupyter Paths : 
16:25:56.996 [info] Process Execution: ~/miniconda3/envs/stations_new/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/pythonFiles/printJupyterDataDir.py
16:25:57.060 [debug] getDataDirsImpl, Class name = jr, completed in 78ms, has a truthy return value, Arg 1: "/var/models/wnetwork_new/scripts/test.ipynb", Arg 2: "~/miniconda3/envs/stations_new/bin/python", Return Value: <Uri:/home/~/.local/share/jupyter>, <Uri:/home/~/miniconda3/envs/stations_new/share/jupyter>, <Uri:/usr/local/share/jupyter>, <Uri:/usr/share/jupyter>
16:26:01.521 [debug] Handle Execution of Cells 57 for /var/models/wnetwork_new/scripts/test.ipynb
16:26:01.538 [debug] Kernel acknowledged execution of cell 57 @ 1719930361537
16:26:04.579 [debug] Handle Execution of Cells 58 for /var/models/wnetwork_new/scripts/test.ipynb
16:26:04.608 [debug] Kernel acknowledged execution of cell 58 @ 1719930364608
16:26:05.022 [warn] Cell completed with errors [hd [Error]: No module named 'lib'
	at r.execute (/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/extension.node.js:307:4958)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)] {
  ename: 'ModuleNotFoundError',
  evalue: "No module named 'lib'",
  traceback: [
    '\x1B[0;31m---------------------------------------------------------------------------\x1B[0m',
    '\x1B[0;31mModuleNotFoundError\x1B[0m                       Traceback (most recent call last)',
    'Cell \x1B[0;32mIn[2], line 1\x1B[0m\n' +
      '\x1B[0;32m----> 1\x1B[0m \x1B[38;5;28;01mfrom\x1B[39;00m \x1B[38;5;21;01mlib\x1B[39;00m\x1B[38;5;21;01m.\x1B[39;00m\x1B[38;5;21;01mdata_utils\x1B[39;00m \x1B[38;5;28;01mimport\x1B[39;00m get_daily\n',
    "\x1B[0;31mModuleNotFoundError\x1B[0m: No module named 'lib'"
  ]
}

I'm honestly clueless. This is the SAME server, with the SAME vscode remote version connecting one minute after....what can it possibly change?
The only notable differences I can see between the two logs are

  • the port (8889 instead than 8888), however I tried to force this and it didn't change anything
  • the [info] Attempting to start a server because of preload conditions ... message

I tested also the connection to a "clean" state where there is no running instance of vscode server or jupyter server (I killed everything before connecting) but I still get the same issue....

@guidocioni
Copy link
Author

guidocioni commented Jul 2, 2024

Cannot believe ChatGPT pointed me in the right direction...by making it analyzing the two different files I indeed realized that the --notebook-dir argument passed when starting jupyter was different.

  • Working Log: --notebook-dir="/var/models/wnetwork_new/scripts".
  • Issue Log: --notebook-dir="/var/models/wnetwork_new".

It was then clear to understand how this could lead to issue as, in my case, the module I'm trying to import is located in /var/models/wnetwork_new/scripts/lib.

I added this line to the settings.json of my workspace only and now everything is working.

    "jupyter.jupyterCommandLineArguments": [
        "--notebook-dir='/var/models/wnetwork_new/scripts'"
    ],

Of course this is only a workaround.
The problem seems so stem from the fact that the notebook file root is not set to ${fileDirname} so the issue may be related to #8771 and microsoft/vscode-jupyter-hub#49

@DonJayamanne
Copy link
Contributor

Thank you for filing this issue and sorry got not getting back sooner.

19:07:08.576 [warn] Exception while attempting zmq : /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromq/prebuilds/linux-x64/node.napi.glibc.node) 19:07:08.577 [warn] Exception while attempting zmq (fallback) : /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromqold/prebuilds/linux-x64/node.napi.glibc.node)
19:07:09.185

I understand there's an issue with the file directory. however I believe the above is part of the problem
Is it possible for you to somehow install GBLIC on your machine.

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) labels Jul 22, 2024
@guidocioni
Copy link
Author

Thank you for filing this issue and sorry got not getting back sooner.

19:07:08.576 [warn] Exception while attempting zmq : /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromq/prebuilds/linux-x64/node.napi.glibc.node) 19:07:08.577 [warn] Exception while attempting zmq (fallback) : /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.5.0-linux-x64/dist/node_modules/zeromqold/prebuilds/linux-x64/node.napi.glibc.node)
19:07:09.185

I understand there's an issue with the file directory. however I believe the above is part of the problem Is it possible for you to somehow install GBLIC on your machine.

Hi,
my previous comment shows that glibc is not part of the problem. This is related to the issues I linked.
I cannot install glibc because this is a.system running on an old centos version.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Jul 22, 2024

The reason I suggested installing glib is because there is a big difference in the way the kennels are started and the cwd is setup

Thanks, will try to send a custom vsix to get some additional logging

Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel)
Projects
None yet
Development

No branches or pull requests

3 participants