データ分析のためのJupyterLab基礎設定２(pip)

# A JupyterLab setting procedure
A base setting with minimum packages via pip

jupyterlab-lspからjupyterlab-kiteに乗り換えたため、pipによるJupyterLab基礎設定の忘備録を新調しました。

jupyterlab-lspを用いた旧バーションは[こちら](https://qiita.com/yuichi-takeuchi/items/f53d4feb2e28a69bd4c3)。

## Prerequisite
- Windows 10
- `python` 3.8+
- `nodejs` 10+
- Microsoft Visual C++ 14.0 or greater (Build Tools for Visual Studio 2019)
- git 2+
- Kite Engine

## Getting Started
### JupyterLab installation
- install [python](https://www.python.org/downloads/) with pip
- install [node.js](https://visualstudio.microsoft.com/downloads/)
- install [Microsoft Visual C++ 14.0 or greater](https://visualstudio.microsoft.com/downloads/)
- install [git](https://git-scm.com/)
- install [Kite Engine](https://www.kite.com/)

#### Making a virtual environment
```
> python -m venv ENV
> cd ENV
> Scripts/activate
(ENV) > pip install jupyterlab
```

### Extensions

#### Extension manager
- [Jupyter Widgets JupyterLab Extension](https://github.com/jupyter-widgets/ipywidgets/tree/master/packages/jupyterlab-manager): for Jupyter/IPython widgets

```
(ENV) > pip install ipywidgets
(ENV) > jupyter nbextension enable --py widgetsnbextension
(ENV) > jupyter labextension install @jupyter-widgets/jupyterlab-manager
```

#### Variable inspector
- [jupyterlab_variableinspector](https://github.com/lckr/jupyterlab-variableInspector): variable inspector

```
(ENV) > jupyter labextension install @lckr/jupyterlab_variableinspector
```
#### Table of contents
- [jupyterlab-toc](https://github.com/jupyterlab/jupyterlab-toc): table of contents for markdown

```
(ENV) > jupyter labextension install @jupyterlab/toc
```

#### File tree
- [jupyterlab_filetree](https://github.com/youngthejames/jupyterlab_filetree): filetree view

```
(ENV) > jupyter labextension install jupyterlab_filetree
```

#### Shortcut key setting user interface
- [jupyterlab-shortcutui](https://github.com/jupyterlab/jupyterlab-shortcutui): ui for shortcut keys

```
(ENV) > jupyter labextension install @jupyterlab/shortcutui
```

#### Notebook-Python-Markdown file synchronization
- [jupytext](https://github.com/mwouts/jupytext): .py file sync with .ipynb

```
(ENV) > pip install jupytext --upgrade
(ENV) > jupyter labextension install jupyterlab-jupytext
```

#### Version control
- [jupyterlab-git](https://github.com/jupyterlab/jupyterlab-git): git control via jupyterlab

```
(ENV) > pip install --upgrade jupyterlab-git
(ENV) > jupyter lab build
```

- [github](https://github.com/jupyterlab/jupyterlab-github): github browsing via jupyterLab

```
(ENV) > jupyter labextension install @jupyterlab/github
```

#### Linter, Autocompletion, Code formatter

- [jupyterlab_code_formatter](https://github.com/ryantam626/jupyterlab_code_formatter): code formatter (black, isort, autopep8, yapf)

```
(ENV) > jupyter labextension install @ryantam626/jupyterlab_code_formatter
(ENV) > pip install jupyterlab_code_formatter
(ENV) > jupyter serverextension enable --py jupyterlab_code_formatter
```

- [Go to definition extension for JupyterLab](https://github.com/krassowski/jupyterlab-go-to-definition): jump to definition

```
(ENV) > jupyter labextension install @krassowski/jupyterlab_go_to_definition
```

- [jupyterlab-kite](https://github.com/kiteco/jupyterlab-kite): AI powered code completion

```
(ENV) > pip install jupyter-kite
(ENV) > jupyter labextension install @kiteco/jupyterlab-kite
```

#### Spell checker
- [jupyterlab_spellchecker](https://github.com/ijmbarr/jupyterlab_spellchecker): spell checker for Markdown

```
(ENV) > jupyter labextension install @ijmbarr/jupyterlab_spellchecker
```

### Other standard packages

```
(ENV) > pip install numpy pandas matplotlib
```

## Add a new kernel
```
(ENV) > ipython kernel install --user --name=ENV
```

## Launch
- Launch jupyterlab

```
(ENV) > jupyter lab
```