12
8

More than 3 years have passed since last update.

JupyterLabでコード補完(jupyterlab-lsp)

Last updated at Posted at 2020-08-09

JupyterLabとは

JupyterLabの課題

  • デフォルトではTabを押さないとコード補完(autocomplete)されない
  • そのため、いくつかコード補完のextentionが提案されている
  • ここでは、jupyterlab-lspについて紹介する

jupyterlab-lspとは

jupyterlab-lspのインストール方法

概要

  • 基本的に、開発元のGithubに従ってインストールすれば動作する
  • ただし、以下をやらないと動作しないので注意(ハマった)
    • "Note on pyls (python-language-server) issues: pyls is known to require specific versions of some dependencies such as ujson <= 1.35, jedi == 0.15.2 and parso == 0.5.2. If you experience any issues with LSP functions in Python, please check if you have the right version using pip freeze command."
    • つまり、「ujson」「jedi」「parso」のバージョンを上記にしなければならない。
    • バージョンが異なると以下のエラーメッセージが出る。
      • ERROR - pyls_jsonrpc.endpoint ...

検証環境

インストール方法

conda環境の準備

conda create -n jupyter_test python=3
conda activate jupyter_test

jupyterlab,jupyter-lspのインストール

conda install -c conda-forge jupyterlab=2.1 ujson=1.35 jedi=0.15.2 parso=0.5.2
pip install jupyter-lsp
conda install -c conda-forge nodejs
jupyter labextension install @krassowski/jupyterlab-lsp
conda install -c conda-forge python-language-server r-languageserver

jupyterlabの起動

jupyter lab
12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8