"jupyter notebook 環境構築~起動" as Code


1. Overview

パクリ集ですが、、、jupyter 環境構築をCodeで行った備忘録です。
(任意)の項を省略すれば jupyter notebook 起動まで瞬殺かと。

参考にさせていただいた
@u1and0さん、@ishizakiiiiさん、@mitamaさん
ありがとうございます。

2. jupyter notebook インストール

Windows 10 Home に Chocolatey をインストールするところから。

jupyter notebook は anaconda に同梱されている。

anaconda3 インストール

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco install -y --execution-timeout=1000000 anaconda3

参考
@u1and0 さん
2行でpythonインストール@Windows
https://qiita.com/u1and0/items/d63546c0d64eceab6b41

3. (任意)jupyter notebook を Dark Thema に

Darkが落ち着くので。(消費電力的にもきっと)

Dark Thema 適用

pip install jupyterthemes
jt -t onedork -fs 95 -altp -tfs 11 -nfs 115 -cellw 88% -T

参考
@ishizakiiii さん
Jupyter Notebookをより便利に使うために、色々まとめ
https://qiita.com/ishizakiiii/items/b98bbf8997f039f40058

4. (任意)jupyter notebook に Slideshow 出力拡張 を

人に資料として見せることを見据えて Slideshow 出力拡張 を行う。

Slideshow 出力拡張

pip install RISE
jupyter-nbextension install rise --py --sys-prefix
jupyter-nbextension enable rise --py --sys-prefix

参考
@ishizakiiii さん
Jupyter Notebookをより便利に使うために、色々まとめ
https://qiita.com/ishizakiiii/items/b98bbf8997f039f40058

5. (任意)jupyter notebook 起動時の初期フォルダ変更

Windows 10 Home の自分の環境だと C:\Windows\System32 が初期フォルダになっていた。
読み込み待ちが長く、 jupyter notebook 起動にやたら時間かかった。
初期フォルダを変更する必要があった。

configファイル生成

jupyter notebook --generate-config

configファイル編集

C:\Users\{user}\.jupyter\jupyter_notebook_config.pyを編集。

例)

c.NotebookApp.notebook_dir = 'C:\\Works\\Projects\\jupyter'

参考
@mitama さん
Jupyter Notebookの初期ディレクトリを変更する
https://qiita.com/mitama/items/a8129e50afcc462e02d6

6. jupyter notebook 起動

> jupyter notebook

以上