4
3

More than 1 year has passed since last update.

Jupyter NotebookをMacにインストールした方法

Posted at

Homebrewのアップデートを行ったら(?)Jupyterがなくなってしまった(?)のでインストールした。
以下のことを記す。

  • Jupyter Notebookのインストール
  • Jupyter Notebookの立ち上げ方
  • Jupyter Labについて

図の描き方はまた別記事にしたいと思う。

はじめに

前提知識は以下の通りである。

  • macOS
  • python3はすでに入っている

Jupyter Notebookは図を作成するときに使っている。
合う合わないはあると思うが、私は使いやすいと思っている。

Jupyter Notebookのインストール

Jupyterがなくなってしまった。

% jupyter --version
zsh: command not found: jupyter

まずはpython, pipのバージョン確認。

% python --version
Python 2.7.18
% python3 --version
Python 3.9.12
% pip --version
pip 20.2.3 from /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
% pip3 --version
pip 22.0.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)

残念ながら私はpython, pipには詳しくない。
コマンドは面倒だけどpython3のままにしてある。

たぶんpip3でインストールすれば良いのだろう。

% pip3 install jupyter

できたっぽい。

% jupyter --version
Selected Jupyter core packages...
IPython          : 8.2.0
ipykernel        : 6.13.0
ipywidgets       : 7.7.0
jupyter_client   : 7.3.0
jupyter_core     : 4.10.0
jupyter_server   : not installed
jupyterlab       : not installed
nbclient         : 0.6.0
nbconvert        : 6.5.0
nbformat         : 5.3.0
notebook         : 6.4.11
qtconsole        : 5.3.0
traitlets        : 5.1.1

notebookがある。これさえあれば大丈夫のはず。

Jupyter Notebookの立ち上げ方

% jupyter notebook  <任意のファイル名>.ipynb &

立ち上げたターミナルは放置。
ChromeでJupyter Notebookが起動されるはず。

おまけ

なぜかNumPy, Matplotlib, SciPyもなくなった。。。

% pip3 install numpy
% pip3 install matplotlib
% pip3 install scipy

Jupyter Lab

ちなみに今はJupyter Labを使っている。
立ち上げ方は

% jupyter lab

である。
Jupyter Notebookよりも使いやすいと感じている。

4
3
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
4
3