jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.81k stars 149 forks source link

Server extension missing #505

Closed dcervenkov closed 3 years ago

dcervenkov commented 3 years ago

Description

JupyterLab fails to find the LSP server extension. The status line shows "Server extension missing".

Quite a few similar issues have been reported before, but the users seem to use various combinations of conda, JupyterHub, and Docker. My setup is very simple in comparison - just plain Python, everything installed via pip.

Reproduce

pip3 install jupyter-client jupyter-contrib-core jupyter-contrib-nbextensions jupyter-core jupyter-latex-envs jupyter-lsp jupyter-nbextensions-configurator jupyter-server jupyterlab jupyterlab-lsp jupyterlab-server
jupyter server extension enable --user --py jupyter_lsp
jupyter serverextension enable --py jupyter_lsp

Not sure if I should be using jupyter server extension or jupyter serverextension - I tried both to no avail.

Expected behavior

Server extension is found and jupyter_lsp works.

Context

Required: installed server extensions
❯ jupyter server extension list
Config dir: /home/dc/.jupyter
    jupyterlab_lsp enabled
    - Validating jupyterlab_lsp...
      jupyterlab_lsp 3.3.0 OK

Config dir: /usr/etc/jupyter

Config dir: /usr/local/etc/jupyter

❯ jupyter serverextension list 
config dir: /home/dc/.jupyter
    jupyter_lsp  enabled 
    - Validating...
      jupyter_lsp 1.1.2 OK
Required: installed lab extensions
❯ jupyter lab extension list   
Config dir: /home/dc/.jupyter
    jupyterlab_lsp enabled
    - Validating jupyterlab_lsp...
      jupyterlab_lsp 3.3.0 OK

Config dir: /usr/etc/jupyter

Config dir: /usr/local/etc/jupyter

❯ jupyter labextension list 
JupyterLab v3.0.7
/home/dc/.local/share/jupyter/labextensions
        @krassowski/jupyterlab-lsp v3.3.0 enabled OK (python, jupyterlab_lsp)
Troubleshoot Output
❯ jupyter troubleshoot
$PATH:
    /opt/root6/bin
    /home/dc/.local/bin
    /home/dc/bin
    /usr/lib/lightdm/lightdm
    /usr/local/sbin
    /usr/local/bin
    /usr/sbin
    /usr/bin
    /sbin
    /bin
    /usr/games
    /snap/bin
    /home/dc/.fzf/bin

sys.path:
    /home/dc/.local/bin
    /opt/root6/lib
    /usr/lib/python36.zip
    /usr/lib/python3.6
    /usr/lib/python3.6/lib-dynload
    /home/dc/.local/lib/python3.6/site-packages
    /usr/local/lib/python3.6/dist-packages
    /usr/lib/python3/dist-packages

sys.executable:
    /usr/bin/python3

sys.version:
    3.6.9 (default, Oct  8 2020, 12:12:24) 
    [GCC 8.4.0]

platform.platform():
    Linux-5.4.0-65-generic-x86_64-with-elementary-5.1.7-hera

which -a jupyter:
    /home/dc/.local/bin/jupyter

pip list:
    Package                           Version
    --------------------------------- ------------------------------------------
    Amby                              1.3
    anyio                             2.0.2
    apipkg                            1.5
    appdirs                           1.4.4
    argon2-cffi                       20.1.0
    asn1crypto                        0.24.0
    astroid                           2.4.2
    async-generator                   1.10
    attrs                             19.3.0
    awkward1                          0.4.5
    Babel                             2.9.0
    backcall                          0.2.0
    black                             19.10b0
    bleach                            3.1.5
    boost-histogram                   0.11.1
    Brlapi                            0.6.6
    cachetools                        4.1.1
    certifi                           2020.11.8
    cffi                              1.14.1
    chardet                           3.0.4
    click                             7.1.1
    cmake                             3.18.4.post1
    command-not-found                 0.3
    ConfigArgParse                    1.0
    contextvars                       2.4
    coverage                          5.3
    cryptography                      2.1.4
    cycler                            0.10.0
    dataclasses                       0.8
    datrie                            0.8
    decorator                         4.4.2
    defer                             1.0.6
    defusedxml                        0.6.0
    distlib                           0.3.1
    distro-info                       0.18ubuntu0.18.04.1
    docutils                          0.16
    entrypoints                       0.3
    execnet                           1.7.1
    filelock                          3.0.12
    flake8                            3.8.4
    fonttools                         4.13.0
    gcalcli                           4.3.0
    gitdb                             4.0.2
    GitPython                         3.1.0
    google-api-core                   1.23.0
    google-api-python-client          1.12.5
    google-auth                       1.23.0
    google-auth-httplib2              0.0.4
    googleapis-common-protos          1.52.0
    greenlet                          0.4.15
    hist                              2.0.1
    histoprint                        1.5.2
    html5lib                          0.999999999
    httplib2                          0.18.1
    idna                              2.10
    immutables                        0.14
    importlib-metadata                2.0.0
    importlib-resources               3.3.0
    iniconfig                         1.1.1
    iotop                             0.6
    ipykernel                         5.3.4
    ipympl                            0.5.7
    ipython                           7.16.1
    ipython-genutils                  0.2.0
    ipywidgets                        7.5.1
    isort                             5.4.2
    jedi                              0.17.2
    Jinja2                            2.11.2
    json5                             0.9.5
    jsonschema                        3.2.0
    jupyter-client                    6.1.11
    jupyter-contrib-core              0.3.3
    jupyter-contrib-nbextensions      0.5.1
    jupyter-core                      4.7.1
    jupyter-highlight-selected-word   0.2.0
    jupyter-latex-envs                1.4.6
    jupyter-lsp                       1.1.2
    jupyter-nbextensions-configurator 0.4.1
    jupyter-server                    1.3.0
    jupyterlab                        3.0.7
    jupyterlab-lsp                    3.3.0
    jupyterlab-server                 2.2.0
    keyring                           10.6.0
    keyrings.alt                      3.0
    kiwisolver                        1.2.0
    language-selector                 0.1
    lazy-object-proxy                 1.4.3
    line-profiler                     3.1.0
    logzero                           1.6.3
    louis                             3.5.0
    lxml                              4.5.2
    MarkupSafe                        1.1.1
    matplotlib                        3.3.1
    mccabe                            0.6.1
    mistune                           0.8.4
    mplhep                            0.2.12
    msgpack                           1.0.0
    mypy                              0.790
    mypy-extensions                   0.4.3
    nbclassic                         0.2.6
    nbconvert                         5.6.1
    nbformat                          5.0.7
    neovim                            0.2.6
    netifaces                         0.10.4
    notebook                          6.1.3
    numpy                             1.19.1
    oauth2client                      4.1.3
    olefile                           0.45.1
    onboard                           1.4.1
    packaging                         20.4
    pandas                            1.0.5
    pandocfilters                     1.4.2
    parsedatetime                     2.6
    parso                             0.7.1
    pathspec                          0.7.0
    patsy                             0.5.1
    pexpect                           4.8.0
    pickleshare                       0.7.5
    Pillow                            7.2.0
    pip                               20.3.3
    pipenv                            2020.11.15
    pluggy                            0.13.1
    pocket                            0.3.6
    prometheus-client                 0.8.0
    prompt-toolkit                    3.0.6
    protobuf                          3.13.0
    psutil                            5.7.2
    ptyprocess                        0.6.0
    py                                1.9.0
    pyasn1                            0.4.8
    pyasn1-modules                    0.2.8
    pycairo                           1.16.2
    pycodestyle                       2.6.0
    pycparser                         2.20
    pycrypto                          2.6.1
    pydocstyle                        2.0.0
    pyflakes                          2.2.0
    Pygments                          2.6.1
    pygobject                         3.26.1
    pyinotify                         0.9.6
    pylint                            2.6.0
    pynvim                            0.4.2
    pyparsing                         2.4.7
    PyQt5                             5.13.2
    PyQt5-sip                         12.7.0
    PyQtWebEngine                     5.13.1
    pyrsistent                        0.16.0
    pytest                            6.1.2
    pytest-cov                        2.10.1
    pytest-forked                     1.3.0
    pytest-xdist                      2.1.0
    python-apt                        1.6.5-ubuntu0.5-elementary17-ubuntu5.1.7.1
    python-dateutil                   2.8.1
    python-debian                     0.1.32
    python-distutils-extra            2.39
    python-jsonrpc-server             0.4.0
    python-language-server            0.36.2
    python-Levenshtein                0.12.0
    pytz                              2020.4
    pyxattr                           0.6.0
    pyxdg                             0.25
    PyYAML                            5.3.1
    pyzmq                             19.0.2
    qhue                              1.0.12
    ratelimiter                       1.2.0.post0
    regex                             2020.2.20
    reportlab                         3.4.0
    requests                          2.24.0
    requests-unixsocket               0.1.5
    rgbxy                             0.5
    root-numpy                        4.8.0
    root-pandas                       0.7.0
    rootpy                            1.0.1
    rope                              0.16.0
    rsa                               4.6
    scipy                             1.5.1
    screen-resolution-extra           0.0.0
    seaborn                           0.9.0
    SecretStorage                     2.3.1
    Send2Trash                        1.5.0
    setuptools                        50.3.2
    simplegeneric                     0.8.1
    six                               1.15.0
    smmap                             3.0.1
    snakemake                         5.10.0
    sniffio                           1.2.0
    snowballstemmer                   1.2.1
    ssh-import-id                     5.7
    statsmodels                       0.11.1
    systemd-python                    234
    terminado                         0.8.3
    testpath                          0.4.4
    toml                              0.10.0
    toposort                          1.5
    tornado                           6.1
    tqdm                              4.54.0
    traitlets                         4.3.3
    typed-ast                         1.4.1
    typing-extensions                 3.7.4.3
    ubuntu-drivers-common             0.0.0
    ufw                               0.36
    ujson                             4.0.2
    ulauncher                         5.9.0
    uncertainties                     3.1.2
    uproot                            4.0.0
    uproot-methods                    0.7.4
    uproot4                           0.1.2
    uritemplate                       3.0.1
    urllib3                           1.25.11
    usb-creator                       0.3.3
    virtualenv                        20.2.1
    virtualenv-clone                  0.5.4
    vobject                           0.9.6.1
    wcwidth                           0.2.5
    webencodings                      0.5.1
    websocket-client                  0.44.0
    wheel                             0.30.0
    widgetsnbextension                3.5.1
    wrapt                             1.12.0
    xkit                              0.0.0
    xrootd                            5.0.3-
    youtube-dl                        2020.12.5
    zipp                              3.4.0

Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
[log.txt](https://github.com/krassowski/jupyterlab-lsp/files/5932154/log.txt)
dcervenkov commented 3 years ago

A minute after I submitted the issue, I solved it. Oh well, maybe this will help someone in the future.

I used pip install python-language-server. Doing pip install "python-language-server[all]" (as the documentation says) fixed the problem.