jupyterlab-lsp icon indicating copy to clipboard operation
jupyterlab-lsp copied to clipboard

.lsp-symlink doesn't seem to work

Open tsjk opened this issue 1 year ago • 3 comments

Description

I use jupyter/tensorflow-notebook:python-3.10 with jupyterlab 3.6.5, jupyter_server 2.7.0 and jupyterlab_server 2.24.0.

Reproduce

  1. ln -s / "${NB_HOME}/.lsp-symlink"
  2. Open your ipynb notebook
  3. Click on an external function call and navigate (ctrl-b)
  4. Observer error

e.g. (for gc.enable())

[W 2023-08-08 07:23:10.018 ServerApp] wrote error: "file or directory does not exist: 'opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi'"
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.10/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
      File "/opt/conda/lib/python3.10/site-packages/jupyter_server/services/contents/handlers.py", line 122, in get
        self.contents_manager.get(
      File "/opt/conda/lib/python3.10/site-packages/jupytext/contentsmanager.py", line 199, in get
        return self.super.get(path, content, type, format)
      File "/opt/conda/lib/python3.10/site-packages/jupyter_server/services/contents/filemanager.py", line 415, in get
        raise web.HTTPError(404, four_o_four)
    tornado.web.HTTPError: HTTP 404: Not Found (file or directory does not exist: 'opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi')
[W 2023-08-08 07:23:10.019 ServerApp] 404 GET /api/contents/opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi?content=0&1691479390013 ([email protected]) 1.84ms referer=http://127.0.0.1:48888/lab/tree/work/Notebook.ipynb
[W 2023-08-08 07:23:10.043 ServerApp] wrote error: "file or directory does not exist: '.lsp_symlink/opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi'"
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.10/site-packages/tornado/web.py", line 1786, in _execute
        result = await result
      File "/opt/conda/lib/python3.10/site-packages/jupyter_server/services/contents/handlers.py", line 122, in get
        self.contents_manager.get(
      File "/opt/conda/lib/python3.10/site-packages/jupytext/contentsmanager.py", line 199, in get
        return self.super.get(path, content, type, format)
      File "/opt/conda/lib/python3.10/site-packages/jupyter_server/services/contents/filemanager.py", line 415, in get
        raise web.HTTPError(404, four_o_four)
    tornado.web.HTTPError: HTTP 404: Not Found (file or directory does not exist: '.lsp_symlink/opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi')
[W 2023-08-08 07:23:10.044 ServerApp] 404 GET /api/contents/.lsp_symlink/opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi?type=file&content=1&format=text&1691479390039 ([email protected]) 1.31ms referer=http://127.0.0.1:48888/lab/tree/work/Notebook.ipynb

However, if I show hidden files and navigate to .lsp_symlink/opt/conda/lib/python3.10/site-packages/jedi/third_party/typeshed/stdlib/3/gc.pyi' I can open the file.

Context

  • Operating System and version: jupyter/tensorflow-notebook:python-3.10 with Podman under Gentoo Linux
  • Browser and version: Chrome v115.0.5790.170
  • JupyterLab version: JupterLab v3.6.5
  • Language server and version: jupyterlab-lsp v4.2.0 with jupyter-lsp-python 2.2.0
Required: installed server extensions
config dir: /opt/conda/etc/jupyter
    dask_labextension  enabled
    - Validating...
      dask_labextension 6.2.0 OK
    ipyparallel  enabled
    - Validating...
      ipyparallel 8.6.1 OK
    jupyter_lsp  enabled
    - Validating...
      jupyter_lsp 2.2.0 OK
    jupyter_server_proxy  enabled
    - Validating...
      jupyter_server_proxy  OK
    jupyter_server_ydoc  enabled
    - Validating...
      X is jupyter_server_ydoc importable?
    jupyterlab  enabled
    - Validating...
      jupyterlab 3.6.5 OK
    jupyterlab_git  enabled
    - Validating...
      jupyterlab_git 0.41.0 OK
    jupyterlab_latex  enabled
    - Validating...
      jupyterlab_latex 3.2.0 OK
    jupyterlab_rise  enabled
    - Validating...
      jupyterlab_rise 0.2.1 OK
    jupytext  enabled
    - Validating...
      jupytext 1.15.0 OK
    nbdime  enabled
    - Validating...
      nbdime 3.2.1 OK
    voila.server_extension  enabled
    - Validating...
      voila.server_extension  OK
Required: installed lab extensions
JupyterLab v3.6.5
/opt/conda/share/jupyter/labextensions
        jupyterlab-plotly v5.15.0 enabled OK
        jupyter-matplotlib v0.11.3 enabled OK
        jupyterlab-jupytext v1.3.9 enabled OK (python, jupytext)
        jupyterlab-quarto v0.1.45 enabled OK (python, jupyterlab-quarto)
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        ipyparallel-labextension v8.6.1 enabled OK
        jupyterlab-rise v0.2.1 enabled OK (python, jupyterlab_rise)
        dask-labextension v6.2.0 enabled OK (python, dask_labextension)
        nbdime-jupyterlab v2.2.0 enabled OK
        @jupyterhub/jupyter-server-proxy v4.0.0 enabled OK
        @voila-dashboards/jupyterlab-preview v2.2.0 enabled OK (python, voila)
        @jupyterlab/git v0.41.0 enabled OK (python, jupyterlab-git)
        @jupyterlab/latex v3.2.0 enabled OK (python, jupyterlab-latex)
        @jupyter-widgets/jupyterlab-manager v5.0.8 enabled OK (python, jupyterlab_widgets)
        @jupyter-lsp/jupyterlab-lsp v4.2.0 enabled OK (python, jupyterlab-lsp)

Other labextensions (built into JupyterLab) app dir: /opt/conda/share/jupyter/lab

tsjk avatar Aug 08 '23 07:08 tsjk

On a side note. Navigating to functions in .py-files located in the current working directory doesn't work either. There it says that "No jump targets found". E.g.

import my_helper
my_helper.init()

where my_helper.py is located in the same directory as the notebook. Navigating to my_helper.init() doesn't work (and yes, the function exists). This is likely another problem.

tsjk avatar Aug 08 '23 07:08 tsjk

@tsjk hi, have you solved this error? I also met it.

Mrfranken avatar Dec 05 '23 15:12 Mrfranken

@Mrfranken - no, I have not... :\

tsjk avatar Dec 06 '23 15:12 tsjk