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


JupyterLabとは

JupyterLabの課題

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

jupyterlab-kiteとは

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

概要

  • CUIだとエラーが出るが無視しても動作する
  • アカウント作成やログインをしなくとも動作する

検証環境

  • ubuntu (Windows10 WSL)
  • anaconda
  • python(3.8)
  • jupyterlab(2.2)

インストール方法

conda環境の準備

conda create -n jupyter_test python=3
conda activate jupyter_test

kiteのインストール

bash -c "$(wget -q -O - https://linux.kite.com/dls/linux/current)"

ここで、以下のエラーが出るが無視する

[installer] error enabling kite-updater.timer. exit status 1, output: 'Created symlink /home/xxxx/.config/systemd/user/basic.target.wants/kite-updater.timer → /home/xxxx/.config/systemd/user/kite-updater.timer.
Failed to connect to bus: No such file or directory
'
ROLLBAR error failed to enable updater service [install error enabling kite-updater.timer exit status 1 Created symlink /home/xxxx/.config/systemd/user/basic.target.wants/kite-updater.timer → /home/xxxx/.config/systemd/user/kite-updater.timer.
Failed to connect to bus: No such file or directory
 Linux DESKTOP-HDE6IOT 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
]
dropping rollbar event due to filtering
[installer] registering kite:// protocol handler
[installer] error installing kite protocol handler. exec: "xdg-mime": executable file not found in $PATH, output: ''
ROLLBAR error failed to enable kite:// protocol handler [install error running 'xdg-mime default kite-copilot.desktop x-scheme-handler/kite' exec: "xdg-mime": executable file not found in $PATH  Linux DESKTOP-HDE6IOT 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
]
dropping rollbar event due to filtering
[installer] kite is installed! launching now! happy coding! :)
[installer] run /home/xxxx/.local/share/kite/kited
[installer]     or launch it using the Applications Menu
Removing kite-installer

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

conda install -c conda-forge jupyterlab nodejs
pip install jupyter-kite
jupyter labextension install "@kiteco/jupyterlab-kite"

jupyterlabの起動

jupyter lab