Setting up Jupyter Lab in a Python 3.9 venv environment

Introduction

――I always forget about the setup, so I will expose the memo.

environment

Installation

Creating a venv environment

$ mkdir jupyterlab-sample
$ ce jupyterlab-sample
$ python3 --version
Python 3.9.0
$ python3 -m venv .venv

Main unit pip install

$ .venv/bin/pip3 install jupyterlab
$ .venv/bin/jupyter-lab --version
2.2.9

Start-up

.venv/bin/jupyter-lab

v Start like this

スクリーンショット 2020-12-14 18.01.41.png

Add package

OK if you install using pip of venv

$ .venv/bin/pip3 install numpy
$ .venv/bin/pip3 install matplotlib

Make it a dark theme

Why ...

スクリーンショット 2020-12-14 19.20.09.png

vim style key binding

スクリーンショット 2020-12-14 19.21.08.png

matplotlib settings

Frequently set settings for matplotlibrc. You can check the path of matplotlibrc currently used by the following method.

from matplotlib import matplotlib_fname
matplotlib_fname()

If it is displayed as ^, it is possible to overwrite the setting by placing a separate matplotlibrc in the working directory with the built-in setting.

Display in Japanese

If you use it normally, Japanese will become tofu, so specify the ttc font file for Mac. I added Hiragino Maru Gothic Pro to the prefix to the original font.sans-serif as follows.

matplotlibrc


font.sans-serif: Hiragino Maru Gothic Pro, DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif

I want to make matplotlib a cool graph

Let's use seaborn. https://github.com/mwaskom/seaborn

Installation

.venv/bin/pip3 install seaborn

Can be used by importing

import seaborn as sns

Set the theme and font to your liking

seaborn.set_style("dark")
sns.set(font='Hiragino Maru Gothic Pro')

from now on

There is an LSP for jupyterlab, so I want to try it properly

https://github.com/krassowski/jupyterlab-lsp

Recommended Posts

Setting up Jupyter Lab in a Python 3.9 venv environment
python3.8 venv environment jupyter notebook
Building a Python environment on a Mac and using Jupyter lab
Memory leak in Python Jupyter Lab (Notebook)?
Build Jupyter Lab (Python) environment with Docker
Using venv in Windows + Docker environment [Python]
Set up a simple HTTPS server in Python 3
Create a Vim + Python test environment in 1 minute
How to create a Python virtual environment (venv)
Ubuntu18.04.05 Creating a python virtual environment in LTS
Create a virtual environment with conda in Python
Set up a test SMTP server in Python.
Think about building a Python 3 environment in a Mac environment
[Venv] Create a python virtual environment on Ubuntu
Work in a virtual environment with Python virtualenv.
Procedure for creating a Python quarantine environment (venv environment)
Use jupyter-lab installed in python virtual environment (venv)
Set up a simple SMTP server in Python
[Docker] Create a jupyterLab (python) environment in 3 minutes!
Install Python Jupyter lab
Create a Python environment
Development environment in Python
From nothing on Ubuntu 18.04 to setting up a Deep Learning environment in Tensor
From setting up Raspberry Pi to installing Python environment
Periodically execute python script with cron in venv environment
Python: Creating a virtual environment (venv), starting and stopping
How to set up a Python environment using pyenv
Build a Python virtual environment using venv (Django + MySQL ①)
Building and enabling a python virtual environment, etc. (venv)
How to use jupyter lab in Windows 10 local environment
Set up a Python development environment with Sublime Text 2
Take a screenshot in Python
Create a function in Python
Create a dictionary in Python
Collaborate in a remote environment
Handle environment variables in Python
Make a bookmarklet in Python
Building a Python virtual environment
venv: Python virtual environment management
Build a Python environment offline
Draw a heart in Python
python standard virtual environment venv
Building a Python virtual environment
Try running python in a Django environment created with pipenv
Building a Jupyter Lab development environment on WSL2 using Anaconda3
[Django3] Display a web page in Django3 + WSL + Python virtual environment
Building a development environment for Android apps-creating Android apps in Python
How to develop in a virtual environment of Python [Memo]
From setting up a Rust environment to running Hello World
Build a Python environment with WSL + Pyenv + Jupyter + VS Code
Create a Python environment for professionals in VS Code on Windows
Building a Python environment on Mac
Maybe in a python (original title: Maybe in Python)
Write a binary search in Python
[python] Manage functions in a list
Hit a command in Python (Windows)
How about Anaconda for building a machine learning environment in Python?
Create a Python environment on Mac (2017/4)
Draw a scatterplot matrix in python
Install scrapy in python anaconda environment
ABC166 in Python A ~ C problem