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

Jupyter Lab LSP integration doesn't work due to LspStdIoWriter failure #612

Closed
KagaJiankui opened this issue May 31, 2021 · 7 comments
Closed

Comments

@KagaJiankui
Copy link

Description

The LSP plugin bundled with pyls can't pop hints even though the plugin and the language server is fully initialized

image

image

The error output in the jupyter server is above, which leads to a invalid argument. I uninstalled the old pyls and moved to pylsp by pip and this maybe the cause of the error, but I'm not sure. The code hint works well in a few strokes initially, and it fails to work after these strokes.

Reproduce

  1. Install jupyter-lsp plugin and the pylsp language server
  2. Open a notebook
  3. Invoke the hint by Tab
  4. See error LspStdIoWriter and Invalid argument error in the command line output of the server

Expected behavior

Context

  • Operating System and version: Windows 10 20H2
  • Browser and version: Microsoft Edge 90.0.818.66
  • JupyterLab version:
    jupyter core : 4.7.1
    jupyter-notebook : 6.3.0
    qtconsole : 5.0.3
    ipython : 7.22.0
    ipykernel : 5.3.4
    jupyter client : 6.2.0
    jupyter lab : 3.0.16
    nbconvert : 6.0.7
    ipywidgets : 7.6.3
    nbformat : 5.1.3
    traitlets : 5.0.5
  • pyls version: 1.0.1
Required: installed server extensions
Config dir: D:\Anaconda\etc\jupyter
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 1.2.0 ok
    jupyter_resource_usage enabled
    - Validating jupyter_resource_usage...
      jupyter_resource_usage  ok
    jupyterlab-system-monitor disabled
    - Validating jupyterlab-system-monitor...
      jupyterlab-system-monitor 0.8.0 ok
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.16 ok
    jupyterlab_code_formatter enabled
    - Validating jupyterlab_code_formatter...
      jupyterlab_code_formatter 1.4.4 ok
    jupyterlab_lsp enabled
    - Validating jupyterlab_lsp...
      jupyterlab_lsp 3.6.0 ok
    jupytext enabled
    - Validating jupytext...
      jupytext 1.10.2 ok
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  ok
Required: installed lab extensions
JupyterLab v3.0.16
d:\anaconda\share\jupyter\labextensions
        jupyterlab-execute-time v2.0.2 enabled ok (python, jupyterlab_execute_time)
        jupyterlab-jupytext v1.3.0 enabled ok (python, jupytext)
        jupyterlab-system-monitor v0.8.0 enabled ok (python, jupyterlab-system-monitor)
        jupyterlab-theme-solarized-dark v2.0.0-dev.1 enabled ok (python, jupyterlab_theme_solarized_dark)
        jupyterlab-topbar-extension v0.6.1 enabled ok (python, jupyterlab-topbar)
        @jlab-enhanced/launcher v3.0.2 enabled ok (python, jlab-enhanced-launcher)
        @jupyter-server/resource-usage v0.5.0 enabled ok (python, jupyter-resource-usage)
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled ok (python, jupyterlab_widgets)
        @krassowski/jupyterlab-lsp v3.6.0 enabled ok (python, jupyterlab-lsp)
        @lckr/jupyterlab_variableinspector v3.0.9 enabled ok (python, lckr_jupyterlab_variableinspector)
        @ryantam626/jupyterlab_code_formatter v1.4.4 enabled ok (python, jupyterlab-code-formatter)

Other labextensions (built into JupyterLab)
app dir: D:\Anaconda\share\jupyter\lab
@aquirdturtle/collapsible_headings v3.0.0 enabled ok
@jlab-enhanced/cell-toolbar v3.2.0 enabled ok
@jupyterlab/katex-extension v3.2.2 enabled ok
@jupyterlab/mathjax3-extension v4.2.2 enabled ok
@krassowski/completion-theme v2.0.0 enabled ok
@krassowski/jupyterlab_go_to_definition v1.0.0 enabled ok
@krassowski/theme-vscode v2.0.0 disabled ok
@yudai-nkt/jupyterlab_city-lights-theme v3.0.0 enabled ok
jupyterlab-code-snippets v2.0.1 enabled ok
nbdime-jupyterlab v2.1.0 enabled ok

Uninstalled core extensions:
@lckr/jupyterlab_variableinspector
@ryantam626/jupyterlab_code_formatter

Disabled extensions:
@jupyterlab/launcher-extension (all plugins)
@jupyterlab/mathjax2-extension:plugin
@krassowski/theme-vscode (all plugins)

The following source extensions are overshadowed by older prebuilt extensions:
@ryantam626/jupyterlab_code_formatter

Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output (recommended for all interface issues)
Paste the output from your browser JavaScript console replacing the text in here.

To learn how to open the developer tools in your browser:
https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools#How_to_open_the_devtools_in_your_browser
If too many messages accumulated after many hours of working in JupyterLab,
consider refreshing the window and then reproducing the bug to reduce the noise in the logs.

@krassowski
Copy link
Member

Thank you for reporting it. As mentioned here I think that it might be an issue with the language server crashing. Could you please try to uninstall python-lsp-server and install jedi-language-server instead and see how it works?

@krassowski
Copy link
Member

Wait, Actually, I see file:// so that might be the url-parse (#595) bug that is crashing the server (the bug was fixed in url-parse but not released). We have a workaround on master branch so installing 3.7.0 should help. I will make the 3.7.0 release now.

@krassowski
Copy link
Member

Could you please try to upgrade to v3.7.0 and see if it still happens?

@KagaJiankui
Copy link
Author

KagaJiankui commented May 31, 2021

I tried the v3.7.0 and the error ceases to occur for a short time, but after a few strokes the same error happens again.
image

@krassowski
Copy link
Member

Could you please provide full log of jupyter lab --debug, from fresh start until the moment the issue appears (and not as a screenshot - it is extremely hard to read for me).

@KagaJiankui
Copy link
Author

I uninstalled the data-science-types package and the error no longer shows up. Maybe the error is caused by this package.

@krassowski
Copy link
Member

Closing as resolved.

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

2 participants