6: 2020-08-16 (Sun) 19:04:38 iseki |
7: 2020-08-18 (Tue) 21:41:45 iseki |
| * Jupyter [#ud5a4e75] | | * Jupyter [#ud5a4e75] |
| + | - python で書かれた Webアプリケーションによる教育・開発用環境 |
| + | - see also : [[JupyterHub]] (マルチユーザ用 Jupiter サーバ) |
| + | #br |
| + | |
| ** Jupyter Notebook [#d5ab1922] | | ** Jupyter Notebook [#d5ab1922] |
| + | - クライアント・サーバモデルであるが,基本的に個人(シングルユーザ)用 |
| + | #br |
| | | |
| *** With Anaconda [#wf6eba52] | | *** With Anaconda [#wf6eba52] |
| | | |
| *** Install [#nb5b4afb] | | *** Install [#nb5b4afb] |
- | (base) conda install -c conda-forge notebook | + | (base) # conda install -c conda-forge notebook |
| #br | | #br |
| + | |
| **** C/C++ サポート [#o92991fb] | | **** C/C++ サポート [#o92991fb] |
- | (base) conda install -c conda-forge xeus-cling | + | (base) # conda install -c conda-forge xeus-cling |
- | (base) pip install jupyter-c-kernel | + | (base) # pip install jupyter-c-kernel |
- | (base) install_c_kernel --sys-prefix | + | (base) # install_c_kernel --sys-prefix |
- | (base) jupyter kernelspec list | + | (base) # jupyter kernelspec list |
| - install_c_kernel で --sys-prefix を付けないと,C用のカーネルがユーザ環境に入る.削除する場合は ''jupyter kernelspec remove c'' | | - install_c_kernel で --sys-prefix を付けないと,C用のカーネルがユーザ環境に入る.削除する場合は ''jupyter kernelspec remove c'' |
| #br | | #br |
| *** 設定 [#m0eb2396] | | *** 設定 [#m0eb2396] |
| 以下のコマンドで設定ファイル ''~/.jupyter/jupyter_notebook_config.py'' が生成される | | 以下のコマンドで設定ファイル ''~/.jupyter/jupyter_notebook_config.py'' が生成される |
- | # jupyter notebook --generate-config | + | (base) # jupyter notebook --generate-config |
| - リモートマシンからの接続を許可するには ''c.NotebookApp.ip = '0.0.0.0' ''とする. | | - リモートマシンからの接続を許可するには ''c.NotebookApp.ip = '0.0.0.0' ''とする. |
| #br | | #br |
| | | |
| *** 実行 [#rf0092bb] | | *** 実行 [#rf0092bb] |
- | # jupyter notebook --allow-root | + | (base) # jupyter notebook --allow-root |
| - port: 8888 | | - port: 8888 |
| #br | | #br |
| - ''jupyterhub_config.py'' で ''c.Spawner.default_url = '/lab''' とする | | - ''jupyterhub_config.py'' で ''c.Spawner.default_url = '/lab''' とする |
| | | |
- | Install | + | - Install |
- | (base) conda install -c conda-forge jupyterlab -y | + | (base) # conda install -c conda-forge jupyterlab -y |
| | | |
- | #br | |
- | | |
- | ** JupyterHub [#mb71944e] | |
- | - Jupyterサーバー(ユーザ認証機能つき) | |
- | - https://horomary.hatenablog.com/entry/2019/11/09/181614 | |
- | #br | |
- | | |
- | *** INSTALL [#nfb5f43c] | |
- | (base) conda create -n jupyterhub python=3.8 -y | |
- | (base) conda activate jupyterhub | |
- | (jupyterhub) conda install -c conda-forge notebook -y | |
- | (jupyterhub) conda install -c conda-forge jupyterlab -y | |
- | (jupyterhub) conda install -c conda-forge jupyterhub -y | |
- | (jupyterhub) conda install -c conda-forge voila -y | |
- | (jupyterhub) conda install jupyter_client -y | |
- | | |
- | (jupyterhub) git clone https://github.com/jupyterhub/nativeauthenticator.git | |
- | (jupyterhub) pip install -e nativeauthenticator | |
- | (jupyterhub) pip install dockerspawner | |
- | #br | |
- | | |
- | *** 設定 [#idb49705] | |
- | - jupyterhub --generate-config を実行すると カレントディレクトリに設定ファイル ''jupyterhub_config.py'' が生成される. | |
- | - 個人的には jupyterhub が /usr/local 以下にある場合は /usr/local/etc/jupyterhub 以下に置く. | |
- | #br | |
- | | |
- | *** 実行 [#a826d7f6] | |
- | (base) conda activate jupyterhub | |
- | (jupyterhub) jupyterhub --no-ssl -f /usr/local/etc/jupyterhub/jupyterhub_config.py | |
- | | |
- | **** 使用ポート [#me192c34] | |
- | - 8000 | |
- | - 8081 | |
- | #br | |
- | | |
- | *** jovyan って誰? [#w4a21247] | |
- | - Docker を使用すると,作業ディレクトリが /home/jovyan/work 固定なのだが? | |
- | - c.DockerSpawner.notebook_dir 辺りをいじっても変化しない? | |
| #br | | #br |
| | | |
| ** Trouble Shooting [#rf83821d] | | ** Trouble Shooting [#rf83821d] |
- | | |
- | *** JupyterHub: PAM使用時に 再login するとPAMの認証エラーになる. [#cec1cefc] | |
- | - バグだろ. | |
- | - Resolve: jupyterhub_config.py に ''c.PAMAuthenticator.open_sessions = False'' を追加する | |
- | - see: https://github.com/jupyterhub/jupyterhub/issues/486 | |
| #br | | #br |