Installation#

Please Read This First#

Delivering LSP features to your JupyterLab requires three pieces:

1. jupyter-lsp#

  • runs in your jupyter_server application on your server to handle requests from the browser to language servers

  • to run, you need:

    • python >=3.8,<3.13.0a0

    • jupyter_server >=1.1.2

2. jupyterlab-lsp#

  • runs in your browser, as an extension to JupyterLab

  • to install it, you need:

    • jupyterlab >=4.1.0,<5.0.0a0

3. Language Servers#

  • run on your server

    • probably in another language runtime than python

  • some can be automatically detected if installed

  • others also need to be configured

Clean installation#

The approaches demonstrated below will ensure that correct versions of Python, JupyterLab and extensions are installed, and are generally recommended for novice users, or users who are not familiar with the Python ecosystem. However, if you feel proficient with using Python package managers such as pip and conda you may prefer to follow the custom installation guide instead, which allows to install the packages in an existing environment.

conda (minimal python)#

When installing from conda-forge, the jupyter-lsp-python bundle includes both the server extension (jupyter-lsp) and pyls (a third-party server also known as python-language-server). You can swap jupyter-lsp-python with another pre-made bundle, jupyter-lsp-r to get get the same server extension but with r-languageserver instead. Alternatively, you can install a language server of your choice manually (see further steps).

%%markdown
```bash
conda create -c conda-forge -n lsp 'python {REQUIRED_PYTHON}' 'jupyterlab={JUPYTERLAB_VERSION}' 'jupyterlab-lsp={JUPYTERLAB_LSP_VERSION}' 'jupyter-lsp-python={JUPYTER_LSP_VERSION}'
conda activate lsp
```

Then run

```bash
jupyter lab
```

Your browser should open to your local server.
conda create -c conda-forge -n lsp 'python >=3.8,<3.13.0a0' 'jupyterlab=4.1.0' 'jupyterlab-lsp=5.1.0' 'jupyter-lsp-python=2.2.5'
conda activate lsp

Then run

jupyter lab

Your browser should open to your local server.

Custom installation#

Get a working JupyterLab environment#

Refer to the official JupyterLab Installation Documentation for your installation approach.

Verify your lab works:

jupyter lab --version
jupyter lab

Install Jupyter[Lab] LSP#

conda#

conda install jupyterlab-lsp=5.1.0

pip#

pip install jupyterlab-lsp==5.1.0

Next step: Language Servers#

Now that you have jupyterlab-lsp, jupyter-lsp and all of their dependencies, you’ll need some language servers. See: