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

Fails when working from a subfolder #16

Open
thoralf-gutierrez opened this issue Dec 5, 2019 · 5 comments
Open

Fails when working from a subfolder #16

thoralf-gutierrez opened this issue Dec 5, 2019 · 5 comments

Comments

@thoralf-gutierrez
Copy link

thoralf-gutierrez commented Dec 5, 2019

Hello!

I'm running into the following issue. When I am working on a notebook within a subfolder, e.g. if I'm working on subfolder/hello.ipynb.

When I am inside hello.ipynb and I try to go to the definition of a function that is outside of my notebook, I see the relevant file appear inside .jupyter_symlinks, and my file tree looks like

* file_at_root.txt
* subfolder/hello.ipynb
* subfolder/.jupyter_symlinks/path/to/file.py

When I try to go to the external definition, it fails to jump, because this api call returns 404

  • jupyterhub.local/user/my_username/api/contents/.jupyter_symlinks/path/to/file.py

But the following api call would have worked

  • jupyterhub.local/user/my_username/api/contents/subfolder/.jupyter_symlinks/path/to/file.py

So it looks like either the .jupyter_symlinks folder should always be at the root of my jupyter folder, or the path in the URL should include the base path of the notebook itself.

Are you seeing the same thing?

@thoralf-gutierrez thoralf-gutierrez changed the title Fails to jump to load jupyter symlink when notebook isn't in root folder Fails when when working from notebook in subfolder Dec 5, 2019
@thoralf-gutierrez thoralf-gutierrez changed the title Fails when when working from notebook in subfolder Fails when when working from a subfolder Dec 5, 2019
@thoralf-gutierrez thoralf-gutierrez changed the title Fails when when working from a subfolder Fails when working from a subfolder Dec 5, 2019
@krassowski
Copy link
Owner

Yes, .jupyter_symlinks should always be at the root of your Jupyter (i.e. where you start JupyterLab from). Apologies if this was not clearly explained in the docs. Is there a reason why you would prefer not to have it in the Jupyter project root?

@thoralf-gutierrez
Copy link
Author

I don't think I did anything special, the .jupyter_symlinks just appeared in the subfolder instead of the root folder. Maybe that's the bug then?

@krassowski
Copy link
Owner

It might be. However, this would be very interesting as normally, the user needs to create the .jupyter_symlinks folder manually. I do not expect it to be created by the extension - it would be useless as it would not know where to symlink to...

Would you mind providing a concrete reproducible example (i.e. where is the file with the definition)?

@thoralf-gutierrez
Copy link
Author

For me the .jupyter_symlinks appears on its own, I've never had to create one.

Reproducible example from home folder that works

  • from the terminal, in jupyter home folder, dorm -rf .jupyter_symlinks/
  • create a new notebook Untitled.ipynb
  • add import json
  • put cursor on json and CTRL + ALT + B and successfully jump to .jupyter_symlinks/usr/lib/python3.5/json/__init__.py
  • notice that .jupyter_symlinks/usr/lib/python3.5/json/__init__.py was created automatically

Reproducible example from subfolder that does not work

@caizefeng
Copy link

Exactly the same problem there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants