{"id":9860,"library":"jupyterlab-lsp","title":"JupyterLab Language Server Protocol (LSP)","description":"jupyterlab-lsp integrates Language Server Protocol (LSP) features directly into JupyterLab, providing coding assistance like autocompletion, hover documentation, linting, and refactoring. As of version 5.3.0, it supports JupyterLab 4.x and is actively maintained with regular updates focusing on compatibility and new LSP features.","status":"active","version":"5.3.0","language":"en","source_language":"en","source_url":"https://github.com/jupyterlab-lsp/jupyterlab-lsp","tags":["jupyter","jupyterlab","lsp","ide","code-completion","language-server","refactoring","linting"],"install":[{"cmd":"pip install jupyterlab-lsp","lang":"bash","label":"Install core extension"},{"cmd":"pip install 'python-lsp-server[all]'","lang":"bash","label":"Install Python language server (recommended for Python users)"}],"dependencies":[{"reason":"Core JupyterLab environment for the extension to run in.","package":"jupyterlab"},{"reason":"Provides Python-specific language server features (e.g., autocompletion, linting). Required for Python language support; other language servers are needed for different languages.","package":"python-lsp-server","optional":true}],"imports":[],"quickstart":{"code":"# hello_lsp.py\nimport os\n\ndef greet(name: str) -> str:\n    \"\"\"\n    Returns a greeting message.\n    Hover over 'greet' for documentation.\n    Type 'greet(' to see signature help.\n    \"\"\"\n    message = f\"Hello, {name}!\"\n    # Type 'message.' to trigger autocompletion provided by LSP\n    return message.upper()\n\nif __name__ == '__main__':\n    user_name = os.environ.get('USER_NAME', 'World')\n    print(greet(user_name))\n","lang":"python","description":"This Python code, when opened in a `.py` file or a notebook within JupyterLab (after `jupyterlab-lsp` and `python-lsp-server` are installed), will demonstrate LSP features. You'll see type hints, signature help, hover documentation, and autocompletion provided by the extension."},"warnings":[{"fix":"Ensure your `jupyterlab-lsp` version matches your `JupyterLab` major version. Upgrade both simultaneously or check the compatibility matrix on the official GitHub page.","message":"Major versions of `jupyterlab-lsp` are tightly coupled to major versions of `JupyterLab`. For example, `jupyterlab-lsp` 4.x is for `JupyterLab` 4.x, and `jupyterlab-lsp` 3.x is for `JupyterLab` 3.x. Installing an incompatible version can lead to errors or the extension not loading.","severity":"breaking","affected_versions":"All major versions (e.g., 3.x.x for JL3, 4.x.x for JL4, 5.x.x for JL4)"},{"fix":"Install the appropriate language server for your desired language. For Python, `pip install 'python-lsp-server[all]'` is commonly used. For other languages, consult the `jupyterlab-lsp` documentation.","message":"After installing `jupyterlab-lsp`, users often expect immediate coding assistance for all languages. However, `jupyterlab-lsp` itself only provides the framework; each language (e.g., Python, R, TypeScript) requires its own specific language server to be installed separately.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Try running `jupyter lab build` in your terminal to rebuild the frontend assets. Additionally, clear your browser cache (Ctrl+Shift+R or Cmd+Shift+R) and restart your JupyterLab server.","message":"Sometimes, after installing or upgrading `jupyterlab-lsp` or other JupyterLab extensions, the frontend assets might become stale or cached incorrectly, leading to features not appearing or errors in the browser console.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install the `python-lsp-server` package in the same environment as JupyterLab: `pip install 'python-lsp-server[all]'`.","cause":"The Python language server (e.g., `python-lsp-server`) is not installed or not discoverable by `jupyterlab-lsp`.","error":"Language Server not found: python"},{"fix":"First, try rebuilding JupyterLab assets: `jupyter lab build`. If the issue persists, verify that `jupyterlab-lsp` is enabled (`jupyter labextension list` and `jupyter server extension list`) and restart your JupyterLab server. Clear your browser cache.","cause":"This error often indicates a problem with the JupyterLab server extension not being loaded correctly, an outdated frontend build, or an incorrect path for server components.","error":"Uncaught (in promise) Error: 404 Not Found"},{"fix":"Install the package: `pip install jupyterlab-lsp`.","cause":"The `jupyterlab-lsp` Python package is not installed in the active Python environment where JupyterLab is running.","error":"ModuleNotFoundError: No module named 'jupyterlab_lsp'"}]}