-
Notifications
You must be signed in to change notification settings - Fork 6
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
Current working directory is ~/
regardless of notebook location
#49
Comments
~/
regardless of notebook location
Thanks for filing this issue and sorry you too are running into this. FYI - There's no need to create a new issue, If you or others run into the exact same issue, then providing information in the same issue is preferred |
I am writing documentation on how to use our JupyterHub with VS Code and now add this following warning: Warning Currently, opening a notebook in VS Code with a JupyterHub kernel will result in an incorrectly set working directory (issue). Do you perhaps know a better workaround? |
Sorry, but I haven't had a chance to look at this yet, Will look into this today. |
Unfortunately I am having the same issue in a similar remote jupyter environment. Some options I have tried that all similarly return the workspace home folder rather than the notebook directory:
I have also confirmed that the "Notebook File Root" setting is ${fileDirname} and not ${workspaceFolder} any help with this would be greatly appreciated! |
@DonJayamanne, any suggestions of where to look in debugging this? |
This does not work with remote servers. Looks like the issue you are running into is microsoft/vscode-jupyter#8771 |
Found that this isn't an issue with VS Code, but thats just how Jupyter Hub works. |
Environment data
Dup of #46 but @DonJayamanne asked for the fully filled in issue template here #46 (comment).
Expected behaviour
I open a notebook, e.g., at
/home/bas.nijholt/adaptive-scheduler/example.ipynb
and select a new kernel from JupyterHub.I check
import os; os.getcwd()
and it shows/home/bas.nijholt
instead of the folder in which the notebook lives (/home/bas.nijholt/adaptive-scheduler
).Actual behaviour
I expect that
import os; os.getcwd()
would return/home/bas.nijholt/adaptive-scheduler
instead of my home folder.See this:
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
~/
import os; os.getcwd()
Logs
Output for
Jupyter
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toJupyter
)For completeness, the full env that runs our JupyterHub instance.
Generated with
micromamba create -n jupyterhub -y python=3.11 jupyterhub jupyterlab notebook ipywidgets
The text was updated successfully, but these errors were encountered: