{"id":771,"library":"jupyter-lsp","title":"Jupyter Language Server Protocol Server Extension","description":"jupyter-lsp acts as a multi-language server WebSocket proxy for Jupyter Notebook and JupyterLab servers. It enables advanced IDE-like features such as code navigation, hover suggestions, linters, and autocompletion in Jupyter environments by leveraging the Language Server Protocol (LSP). It works in conjunction with a frontend extension, typically `jupyterlab-lsp`, and specific language servers (e.g., `python-lsp-server`). The library is actively maintained, with version 2.3.0 being the current stable release, supporting Python >=3.8.","status":"active","version":"2.3.0","language":"python","source_language":"en","source_url":"https://github.com/jupyter-lsp/jupyter-lsp","tags":["jupyter","jupyterlab","lsp","language server protocol","ide features","code assistance","server extension"],"install":[{"cmd":"pip install jupyter-lsp jupyterlab-lsp 'jupyterlab>=4.1.0' python-lsp-server","lang":"bash","label":"For JupyterLab (includes frontend and a Python language server)"},{"cmd":"conda install -c conda-forge jupyter-lsp jupyterlab-lsp 'jupyterlab>=4.1.0' python-lsp-server","lang":"bash","label":"For JupyterLab with Conda"}],"dependencies":[{"reason":"Provides the frontend (JupyterLab) integration for LSP features.","package":"jupyterlab-lsp","optional":false},{"reason":"The primary Jupyter frontend environment where jupyter-lsp is typically used. Requires >=4.1.0 for recent jupyterlab-lsp versions.","package":"jupyterlab","optional":false},{"reason":"An example of a specific language server needed for Python LSP features. Users must install appropriate language servers for their desired languages (e.g., 'bash-language-server', 'vscode-html-languageserver-bin').","package":"python-lsp-server","optional":true}],"imports":[{"note":"Its functionality is enabled by installing it as a Jupyter server extension. Configuration is done via Jupyter config files (JSON or Python) rather than direct Python imports for end-users.","symbol":"jupyter_lsp","correct":"jupyter-lsp is primarily a server extension and not typically imported directly in user-facing Python code within a notebook or script for its core functionality."}],"quickstart":{"code":"# Install jupyter-lsp and the JupyterLab frontend extension\npip install jupyter-lsp jupyterlab-lsp 'jupyterlab>=4.1.0'\n\n# Install a language server for Python (e.g., python-lsp-server)\npip install python-lsp-server\n\n# If using other languages, install their respective LSP servers, e.g., for R:\n# Rscript -e 'install.packages(\"languageserver\")'\n\n# After installation, restart your JupyterLab instance to enable the extensions.\n# You can then verify the installation and configure language servers via:\n# JupyterLab Settings -> Settings Editor -> Language Servers (Experimental)\n\n# Example of how you might enable the server extension if not auto-detected (less common now):\n# jupyter server extension enable jupyter_lsp --py --sys-prefix\n\n# To verify server extensions are enabled (run in terminal):\n# jupyter server extension list","lang":"bash","description":"This quickstart guides you through installing `jupyter-lsp`, its JupyterLab frontend counterpart `jupyterlab-lsp`, and a common Python language server. After installation, a restart of JupyterLab is crucial for the extensions to be recognized. Language server configurations can then be managed through JupyterLab's settings."},"warnings":[{"fix":"Ensure `jupyterlab-lsp` is installed for JupyterLab, and install the specific language server(s) for the languages you intend to use.","message":"Installing `jupyter-lsp` alone is not enough; you must also install a separate frontend extension (like `jupyterlab-lsp` for JupyterLab) AND at least one language server (e.g., `python-lsp-server` for Python) to get any LSP features. `jupyter-lsp` is only the backend proxy.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Close and reopen your JupyterLab or Jupyter Notebook session after installation.","message":"JupyterLab (and sometimes Jupyter Notebook) must be restarted after installing `jupyter-lsp` and `jupyterlab-lsp` for the extensions and language servers to be properly recognized and activated.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Temporarily run `%config Completer.use_jedi = False` in a notebook cell, or add `c.Completer.use_jedi = False` to your `ipython_config.py` for a permanent solution.","message":"For Python, disabling Jedi (e.g., `%config Completer.use_jedi = False` in IPython or in `ipython_config.py`) can prevent conflicts and improve autocompletion performance when using LSP servers like `python-lsp-server` (which often use Jedi internally).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Jupyter environment is compatible. For `jupyter-lsp` 2.x, use Jupyter Server or a recent JupyterLab installation (which typically bundles Jupyter Server).","message":"`jupyter-lsp` versions 0.x were designed for Jupyter Notebook Server, while versions 1.x and above are for Jupyter Server. Installing `jupyter-lsp` 2.x with an older Jupyter Notebook environment might lead to unexpected behavior or failure to load.","severity":"breaking","affected_versions":"Pre-1.0 to 1.x and 2.x"},{"fix":"Consult the `jupyter-lsp` documentation for the correct configuration key names for your installed version. Update your `jupyter_server_config.json` or Python configuration files accordingly.","message":"Configuration keys for language servers have changed over time. For example, `language_servers` became `languageServers` and `pyls.serverSettings` became `pylsp.configuration`. Using old configuration keys can prevent language servers from loading or behaving as expected.","severity":"breaking","affected_versions":"Older versions transitioning to newer ones (exact transition points vary per key)"},{"fix":"Create a symlink (`.lsp_symlink`) in your Jupyter root pointing to `/` (or `C:\\` on Windows), or modify `jupyter_server_config.py` as per documentation to extend file access.","message":"By default, Jupyter Server might restrict access to files outside its root directory. For LSP features like 'Jump to Definition' to work with system-wide installed packages or virtual environments, you might need to create a symlink to your system root (e.g., `.lsp_symlink` in your Jupyter root) or configure `jupyter_server_config.py` to allow broader file access.","severity":"gotcha","affected_versions":"All versions on Linux/OSX, potentially others depending on server configuration"},{"fix":"Execute `pip install jupyter-lsp jupyterlab-lsp 'jupyterlab>=4.1.0'` directly in your shell/terminal, or if running from a Python script, use `import subprocess; subprocess.run(['pip', 'install', 'jupyter-lsp', 'jupyterlab-lsp', 'jupyterlab>=4.1.0'])`.","message":"Attempting to run shell commands like `pip install` directly within a Python script (e.g., `/script.py`) will result in a `SyntaxError`. Shell commands must be executed using appropriate methods such as `subprocess.run()` or by running the script from a shell.","severity":"breaking","affected_versions":"All Python versions"},{"fix":"Ensure `pip install` commands are executed in a shell environment (e.g., via a `.sh` script or directly in the terminal). If running from a Python script, use `subprocess.run(['pip', 'install', 'package_name'])` or similar methods to invoke shell commands.","message":"`pip install` is a shell command and cannot be directly executed as Python syntax within a `.py` file. Attempting to do so will result in a `SyntaxError`.","severity":"breaking","affected_versions":"All Python versions (this is a fundamental language syntax rule)"}],"env_vars":null,"last_verified":"2026-05-12T18:51:58.913Z","next_check":"2026-09-29T00:00:00.000Z","problems":[{"fix":"Install the appropriate language server for your desired language (e.g., `pip install 'python-lsp-server[all]'` or `conda install -c conda-forge python-lsp-server`). Then, completely restart your JupyterLab server. Verify activation in JupyterLab's \"Settings Editor\" under \"Language Servers (Experimental)\".","cause":"`jupyter-lsp` provides the framework but requires specific language servers (e.g., `python-lsp-server` for Python) to be installed separately, and JupyterLab often needs a restart after installation.","error":"LSP features (e.g., autocompletion, diagnostics, hover) not working, or status bar shows \"Initialized (additional server needed)\""},{"fix":"Ensure compatible versions of `jupyterlab-lsp`, `jupyter-lsp`, and the specific language server are installed. Restart your JupyterLab server. Check the JupyterLab server logs (`jupyter lab --debug`) for more specific error messages from the language server. If running in a proxied environment like JupyterHub, verify the WebSocket proxy configuration.","cause":"This issue indicates a failure in the WebSocket communication between JupyterLab and the `jupyter-lsp` backend, or between `jupyter-lsp` and the actual language server, often due to a crashing language server, incompatible versions, network/firewall issues, or complex proxy configurations (e.g., in JupyterHub).","error":"Connection lost, reconnecting in 0 seconds.\" or LSP status indicator stuck at \"connecting...\""},{"fix":"Ensure R is properly installed and add the directory containing the `Rscript` executable (e.g., `Rscript.exe` on Windows) to your system's PATH environment variable. Restart your terminal session and JupyterLab to apply the PATH changes. You can verify `Rscript` is in PATH by running `Rscript -e \"cat(system.file(package='languageserver'))\"` in your terminal.","cause":"The `r-languageserver` or other R-based LSP servers require the `Rscript` executable to be available in the system's PATH environment variable to function correctly.","error":"Rscript not found. Please ensure that RScript executable is in the PATH"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"2.3.1","cli_name":"","cli_version":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","installed_version":null,"pypi_latest":"2.3.1","is_stale":null,"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"195.8M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":16.6,"import_time_s":null,"mem_mb":null,"disk_size":"181M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"208.1M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":17.8,"import_time_s":null,"mem_mb":null,"disk_size":"194M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"212.7M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":15.7,"import_time_s":null,"mem_mb":null,"disk_size":"202M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"212.6M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":15.2,"import_time_s":null,"mem_mb":null,"disk_size":"201M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"195.2M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":null,"install_time_s":18.9,"import_time_s":null,"mem_mb":null,"disk_size":"180M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"jupyter-lsp","exit_code":1,"wheel_type":null,"failure_reason":null,"import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}