A JupyterLab setting procedure

A base setting with minimum packages via pip
pipによるJupyterLabの基礎設定です。

Prerequisite

    • Windows 10

python 3.8+

nodejs 10+
Microsoft Visual C++ 14.0 or greater (Build Tools for Visual Studio 2019)

Getting Started

JupyterLab installation

    • install python (official not Anaconda)

 

    • install node.js

install Microsoft Visual C++ 14.0 or greater

make a virtual environment

> python -m venv ENV # path/to/new/virtual/environment
    come into the virtual environment
> cd ENV
    activate the virtual environment
Scripts/activate
    install jupyterlab
(ENV) > pip install jupyterlab

Extensions

Jupyter Widgets JupyterLab Extension: for Jupyter/IPython widgets

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

jupyterlab_variableinspector: variable inspector

(ENV) > jupyter labextension install @lckr/jupyterlab_variableinspector

jupyterlab-toc: table of contents for markdown

(ENV) > jupyter labextension install @jupyterlab/toc

jupyterlab_filetree: filetree view

(ENV) > jupyter labextension install jupyterlab_filetree

Go to definition extension for JupyterLab: jump to definition

(ENV) > jupyter labextension install @krassowski/jupyterlab_go_to_definition

Language Server Protocol : Python language server protocol

(ENV) > pip install jupyter-lsp
(ENV) > jupyter labextension install @krassowski/jupyterlab-lsp
(ENV) > pip install python-language-server[all]

jupyterlab_code_formatter: code formatter (black, yapf, autopep8, or isort)

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

jupytext: .py file sync with .ipynb

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

git: git control with jupyterlab

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

github: github browsing via jupyterLab

(ENV) > jupyter labextension install @jupyterlab/github

jupyterlab-shortcutui: ui for shortcut keys

(ENV) > jupyter labextension install @jupyterlab/shortcutui

Other standard packages

(ENV) > pip install numpy pandas scipy matplotlib seaborn statsmodels

Add a new kernel

(ENV) > ipython kernel install --user --name=ENV

Launch

    Launch jupyterlab
(ENV) > jupyter lab

Save requirements file

(ENV) > pip freeze > requirements.txt
广告
将在 10 秒后关闭
bannerAds