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

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

Open
1 of 2 tasks
ndgayan opened this issue May 2, 2024 · 8 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, install ipykernel)

Comments

@ndgayan
Copy link

ndgayan commented May 2, 2024

Applies To

  • 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 ndgayan added the bug Issue identified by VS Code Team member as probable bug label May 2, 2024
@DonJayamanne
Copy link
Contributor

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 DonJayamanne self-assigned this May 2, 2024
@DonJayamanne DonJayamanne added notebook-kernel Kernels issues (start/restart/switch, install ipykernel) user-setup Issues caused by incorrectly configured python environments, packages, or the like labels May 2, 2024
@ndgayan
Copy link
Author

ndgayan commented May 2, 2024

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.

@DonJayamanne
Copy link
Contributor

Sorry. I think you misunderstood my question.

Oh sorry, I have indeed, thanks

@DonJayamanne DonJayamanne reopened this May 3, 2024
@DonJayamanne
Copy link
Contributor

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 DonJayamanne added info-needed Issue requires more information from poster and removed user-setup Issues caused by incorrectly configured python environments, packages, or the like labels May 3, 2024
@ndgayan
Copy link
Author

ndgayan commented May 7, 2024

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.

@DonJayamanne
Copy link
Contributor

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.

@bankotibi
Copy link

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

@Null404bad
Copy link

Null404bad commented Jun 3, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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, install ipykernel)
Projects
None yet
Development

No branches or pull requests

4 participants