vscode-jupyter icon indicating copy to clipboard operation
vscode-jupyter copied to clipboard

No effect after setting the "jupyter.notebookFileRoot": "${fileDirname}". Always default to the ${workspaceFolder}.

Open ndgayan opened this issue 9 months ago • 8 comments

Applies To

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

What happened?

The file root is always the workspace folder in 2024.4.0. No effect after setting to "jupyter.notebookFileRoot": "${fileDirname}". However, the 2024.3.1 version is working fine.

VS Code Version

Version: 1.89.0

Jupyter Extension Version

2024.4.0

Jupyter logs

No response

Coding Language and Runtime Version

Python 3.10

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

ndgayan avatar May 02 '24 20:05 ndgayan

Thanks for filing this issue and sorry you are running into this.

The file root is always the workspace folder in 2024.4.0. No effect after setting to "jupyter.notebookFileRoot": "${fileDirname}". However, the 2024.3.1 version is working fine.

Given this works in the latest version of the Jupyter extension, I would suggest updating to the latest version. We do not back port fixes to older versions.

DonJayamanne avatar May 02 '24 20:05 DonJayamanne

Sorry. I think you misunderstood my question. The issue is in the current version of the extension. The issue is no effect after setting the "jupyter.notebookFileRoot": "${fileDirname}". it is always default to the ${workspaceFolder}. I can't set it to the ${fileDirname} in the latest version of the extension.

However, order version of the extension is working fine.

ndgayan avatar May 02 '24 20:05 ndgayan

Sorry. I think you misunderstood my question.

Oh sorry, I have indeed, thanks

DonJayamanne avatar May 03 '24 15:05 DonJayamanne

Please can you share the folder structure?

  • Have you got a workspace folder opened?
  • What is your workspace folder path & what is your path to the Python file?

I've tried this with the latest version of Jupyter extension and VS Code and this works as expected.

Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to verbose
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel.

DonJayamanne avatar May 03 '24 16:05 DonJayamanne

Sorry about the late reply,

Using remote SSH:

Below is the process to activate Python environment.

Workspace folder settings.json set to "python.pipenvPath": "/opt/python/venvs/my_env", "python.defaultInterpreterPath": "/opt/python/venvs/my_env/bin/python3", "jupyter.notebookFileRoot": "${fileDirname}"

Assume the notebook is in two Test folders deep from the workspace folder root.

From the old version of the extension. [v2024.3.1]

import os
os.getcwd()
# /<Path to Workspace Folder>/Test/Test

From the current version of the extension. [v2024.4.0]

import os
os.getcwd()
# /<Path to Workspace Folder>

You can clearly see the "jupyter.notebookFileRoot": "${fileDirname}" not reading or using the newer version of the extension. Could you use Git to compare the code changes related to this issue?

I'll work on getting Jupyter logs from both versions of the extensions and get permission to post here.

ndgayan avatar May 07 '24 13:05 ndgayan

Thank you for the logs, sorry I missed this. Will try to repro this, unfortunately I couldn't repro this locally. Will try with SSH.

DonJayamanne avatar May 20 '24 21:05 DonJayamanne

I'm also facing the same issue with the remote-ssh extension. The host machine is windows 10 and the server is linux (rhel7).

bankotibi avatar May 21 '24 12:05 bankotibi

Thank you for the logs, sorry I missed this. Will try to repro this, unfortunately I couldn't repro this locally. Will try with SSH.

I'm facing the similar issue. Downgrading jupyter notebook extension doesn't work for me. I'm wondering if it's caused by OS since Visual Studio Code Server no longer support old linux distribution recently. And I upload my jupyter log here:

  • Jupyter Logs.txt
  • /home/username/ or ~/ is my working space
  • ~/PythonFiles/ASR/test.ipynb is the filepath

Hope you can tell me how to fix this. I'm really suffering from this issue because I have to use the absolute filepath every time. Thanks a lot.

Null404bad avatar Jun 03 '24 03:06 Null404bad

Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to verbose
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel (use the command Jupyter: Show Output to get to the logs).

DonJayamanne avatar Jul 22 '24 01:07 DonJayamanne

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!