flagflag  
Page Top

Jupyter Notebook anchor.png

  • クライアント・サーバモデルであるが,基本的に個人(シングルユーザ)用
     
Page Top

With Anaconda anchor.png

  • Python(pip) 環境で入れる方法と Anaconda 環境で入れる方法がある.
  • 色々調べると Anaconda の方が使い易い様子.というか,Anaconda には最初からデフォルトで Jupyter Notebook が入っている!
  • (base) jupyter notebook --allow-root --ip=0.0.0.0
  • (base) jupyter lab --allow-root --ip=0.0.0.0
     
  • その後,「データサインティスト以外は Anaconda は使用しばい方が良い」との記事を見つける.
    • Anacondaでは足りないパッケージがあって,結局 pip でそれらを追加していくと,どこかで環境が破壊される可能性があるみたい.
       
Page Top

Install anchor.png

Page Top
anaconda anchor.png
  • anaconda を入れる
  • anaconda 環境で conda を使ってインストールする
    (base) # conda install -c conda-forge notebook
  • C/C++ サポート
    (base) # conda install -c conda-forge xeus-cling
    (base) # pip install jupyter_c_kernel
    (base) # install_c_kernel --sys-prefix
    (base) # jupyter kernelspec list
  • xeus-cling は anaconda 環境 (conda init) でないとインストールできないかも
  • install_c_kernel で --sys-prefix を付けないと,C用のカーネルがユーザ環境に入る.削除する場合は jupyter kernelspec remove c
     
Page Top
pip を使用する. anchor.png
yum install nodejs
yum install python3-pip
pip install numpy scipy matplotlib seaborn scikit-learn pandas psycopg2 ipython-sql pymysql
pip install jupyter
pip install notebook
pip install jupyterlab
jupyter notebook --version
jupyter lab --versopn
 
Page Top

設定 anchor.png

以下のコマンドで設定ファイル ~/.jupyter/jupyter_notebook_config.py が生成される

(base) # jupyter notebook --generate-config
  • リモートマシンからの接続を許可するには c.NotebookApp.ip = '0.0.0.0' とする.
     
Page Top

実行 anchor.png

(base) # jupyter notebook --allow-root  --ip=0.0.0.0
  • port: 8888
     
Page Top

サブコマンド anchor.png

  • jupyter [subcommand] を実行することと,jupyter-[subcommand] を実行することは同じ.
    $ \ls jupyter-*
    jupyter-bundlerextension     jupyter-kernel        jupyter-labhub       jupyter-nbextensions_configurator  jupyter-serverextension
    jupyter-contrib              jupyter-kernelspec    jupyter-migrate      jupyter-notebook                   jupyter-troubleshoot
    jupyter-contrib-nbextension  jupyter-lab           jupyter-nbconvert    jupyter-run                        jupyter-trust
    jupyter-extension            jupyter-labextension  jupyter-nbextension  jupyter-server
Page Top

JupyterLab anchor.png

Page Top

設定 anchor.png

  • Jupyter Notebookの後継. WebアプリケーションによるIDE
  • jupyterhub_config.pyc.Spawner.default_url = '/lab' とする
  • Install
    (base) # conda install -c conda-forge jupyterlab -y
  • アクセス中にクラシックノートブックにアクセスするには /user/{username}/tree にアクセス
    • /lab に戻るには /user/{username}/lab にアクセス
       
Page Top

Command anchor.png

Page Top
Update anchor.png
  • conda update -c conda-forge jupyterlab
  • jupyter labextension update --all
    • Node.js(nodejs >=12.0.0)が必要
       
Page Top
Version anchor.png
  • jupyter lab --version
     
Page Top

nbextensions anchor.png

  • jupyter nbextension list
     
Page Top
nbextensions_configurator anchor.png
  • ブラウザのタブ上で nbextensions の切り替えができる.
  • --user オプションを付けると個人環境にインストールされる
(jupyterhub) # pip install jupyter_nbextensions_configurator
(jupyterhub) # jupyter nbextensions_configurator enable --user
 
Page Top
contrib-nbextensions anchor.png
  • 拡張機能
  • --user オプションを付けると個人環境にインストールされる
(jupyterhub) # pip install jupyter-contrib-nbextensions
(jupyterhub) # jupyter contrib nbextension install --user
 
Page Top
JupyterHub でのコンテナ設定 anchor.png
  • Dockerfile
    RUN  /opt/conda/bin/conda install -c conda-forge jupyter_contrib_nbextensions -y
    RUN  /opt/conda/bin/conda install -c conda-forge jupyter_nbextensions_configurator -y
    RUN  /opt/conda/bin/jupyter nbextension install --sys-prefix --py jupyter_nbextensions_configurator --overwrite
    RUN  /opt/conda/bin/jupyter nbextension enable  --sys-prefix --py jupyter_nbextensions_configurator
    RUN  /opt/conda/bin/jupyter serverextension enable --sys-prefix --py jupyter_nbextensions_configurator
     
Page Top
nbgrader anchor.png
Page Top

labextensions anchor.png

  • jupyter labextension list
     
Page Top

Notebook anchor.png

 

Front page   Freeze Diff Backup Copy Rename Reload   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)
Counter: 1261, today: 3, yesterday: 0
Last-modified: 2023-04-26 (Wed) 09:34:57 (JST) (369d) by iseki

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthApr 2024Next Month
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Today

Who's Online

79 user(s) are online (17 user(s) are browsing xpwiki)

Members: 0
Guests: 79

more...

Access Counter

Today : 1194511945119451194511945
Yesterday : 1529415294152941529415294
Total : 2340664523406645234066452340664523406645234066452340664523406645
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com