LoginSignup
0
1

More than 1 year has passed since last update.

Jupyter Notebookのカーネルの設定

Last updated at Posted at 2021-07-30

はじめに

Jupyter Notebookに仮想環境の設定を反映させるためにカーネルを設定する。

環境

macOS: Catalina 10.15.7
xCode: version 12.4

カーネルの作成

まずは、任意の仮想環境に入る。

terminal
$ pyenv activate <name>

pipを用いてipykernelをインストール。

terminal
$ pip3 ipykernel

他に必要なライブラリをインストール。

terminal
$ pip3 install jupyter matplotlib numpy pandas scipy scikit-learn #なんでも良い

好きな名前をつけてカーネルを作成する。

terminal
$ python3 -m ipykernel install --user --name=<name>

jupyter notebookでブラウザを開いたら、新規作成の際に上で作成したカーネルを選ぶ。必要なライブラリがインストールされた環境で作業を行うことができる。

カーネルの確認

terminal
$ jupyter kernelspec list

カーネルの消去

terminal
$ jupyter kernelspec uninstall <name>
0
1
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
0
1