0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

z/OS上でJupyter Labを動かしてみた

Last updated at Posted at 2026-01-26

はじめに

タイトルの通り、z/OS上でJupyter Labを動かしてみたのでその時のログを記載しておきます。

Pythonの開発環境としてはPC上に準備するのが一般的だと思います。また、Python実行環境がLinuxサーバーで開発環境がWindowsPCだったとして、その場合VS CodeのRemote Development経由でローカルと同じように開発できてしまうわけです。

ですが、z/OS上のPython環境はさすがに特殊すぎるので互換性が保たれないケースも多いかと思いますし、z/OS版Pythonは基本USS(Unix System Service)上で稼働するもののVS CodeのRemote Developmentは、2026年1月現在、残念ながらz/OS USSには対応していないようです。

参考:
GitHub: vscode-remote-release issue #6693 Support ssh to IBM z/OS (USS)

z/OS版のPythonはまだまだ浸透しておらずこれからというところだと思いますが、それ故に開発環境なども整備しきれていないところがあるのだと思います。
そんな中、z/OS版のPythonについて調べていると、Jupyter Labが動かせそうだというのが分かったので(z/OS版のJupyter Labのパッケージが提供されている!)、なにはともあれ動かしてみようということでやってみました。
z/OS上でPythonを稼働させたい場合の開発環境の選択肢になりうるかもしれません。

前提

今回試した環境は以下の通りです。

  • z/OS V3.1
  • IBM Open Enterprise SDK for Python 3.12.10

Python自体はインストール済みの想定とします。

Jupyter LabはPython AI Toolkit for IBM z/OSで提供されるz/OS版のパッケージを使用します。

z/OS版Pythonについては、以下の記事もご参照ください。
Python for z/OS のインストール
Python for z/OS についてのメモ

手順例

今回使用するz/OS環境は、インターネットに直接接続可能な環境で実施しています。一般的にはz/OS環境はセキュアなネットワーク上に構成されていることが多く、インターネットに直接接続できないケースが多いと思います。

参考: Python for z/OS についてのメモ - パッケージについて

オフライン環境でのパッケージインストールについては上の記事にも記載している通り、いくつかやり方があります。手っ取り早いやり方としてwhlファイルを個別に入手してインストールする方法がありますが、依存関係のあるパッケージを調査するのが一筋縄ではいきません。当記事は必要なパッケージを芋づるしきに引っ張ってくるやり方でインストールしていますので、必要なパッケージの判断の参考にしていただけると思います。

また、z/OS版のPythonはUSS上で稼働するものですので、以下の手順は基本的にSSH経由でUSSに接続しUSSのシェルで実行することになります。

Python仮想環境の準備

仮想環境を作成してActivate

TAGUCHI:/SYSTEM/tmp/Python # python -m venv venv312_test05

TAGUCHI:/SYSTEM/tmp/Python # . ./venv312_test05/bin/activate

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # python --version
IBM Open Enterprise SDK for Python 3.12.10

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # pip list
Package Version
------- -------
pip     25.1.1

※仮想環境用に使用されるディレクトリ配下はzFSを分けて管理するのが望ましいと思われますが、ここでは割愛。

JupyterLabインストール

requirementsファイルの作成

requirements_jupyter_lab.txt
#####
#
# Python AI Toolkit for IBM z/OS
#
# This is the complete list of packages that make up the Python AI
# Toolkit for IBM z/OS.
#
# Example use:  pip install --no-deps -r <toolkit_requirements.txt>
#
# pip command options:
--index-url https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/simple
--trusted-host downloads.pyaitoolkit.ibm.net
#--require-hashes
--only-binary :all:

#
# This requirements file was generated for a cp312 environment.
#

#jupyterlab==4.1.2.post0 --hash=sha256:2463c368d7d3cdfc87dcebf0bc38bc0cc904a62c137cbbc78978a09b51f66ef0
jupyterlab==4.1.2.post0

※ここではjupyterlabのみパッケージを指定し、hash値をはずしてhash値のチェックをバイパスしています。セキュリティ的な観点から言えば、必要なパッケージを調査したのち、hash値を含む各パッケージのリストをrequirementsファイルに記述するのが推奨です。
今回は依存関係を自動判別させるために簡易的な方法として上の手順としています。なりすまし等や改ざんにより不当なパッケージをインストールしてしまうリスクがありますのでご注意ください。

インストール

pip installコマンドによりrequirementsファイルをもとにインストール実行

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # pip install --no-cache-dir -r requirements_jupyter_lab.txt
adding trusted host: 'downloads.pyaitoolkit.ibm.net' (from line 12 of requirements_jupyter_lab.txt)
Looking in indexes: https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/simple
Collecting jupyterlab==4.1.2.post0 (from -r requirements_jupyter_lab.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/jupyterlab/4.1.2.post0/jupyterlab-4.1.2.post0-py3-none-any.whl (11.5 MB)
     qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 11.5/11.5 MB 27.5 MB/s eta 0:00:00
Collecting async-lru>=1.0.0 (from jupyterlab==4.1.2.post0->-r requirements_jupyter_lab.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/async-lru/2.0.5/async_lru-2.0.5-py3-none-any.whl (6.6 kB)
Collecting defusedxml (from jupyterlab==4.1.2.post0->-r requirements_jupyter_lab.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/defusedxml/0.7.1.post3/defusedxml-0.7.1.post3-py2.py3-none-any.whl (28 kB)
Collecting httpx>=0.25.0 (from jupyterlab==4.1.2.post0->-r requirements_jupyter_lab.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/httpx/0.27.0/httpx-0.27.0-py3-none-any.whl (90 kB)
Collecting ipykernel (from jupyterlab==4.1.2.post0->-r requirements_jupyter_lab.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/ipykernel/6.9.1.post0/ipykernel-6.9.1.post0-py3-none-any.whl (142 kB)

(省略)

Installing collected packages: wcwidth, pure_eval, ptyprocess, pickleshare, nbconvert, fastjsonschema, backcall, websocket-client, webcolors, urllib3, uri-template, types-python-dateutil, traitlets, tornado, sniffio, six, send2trash, rfc3986-validator, pyzmq, pyyaml, python-json-logger, pyrsistent, pygments, pycparser, prompt-toolkit, prometheus-client, platformdirs, pexpect, parso, packaging, nest-asyncio, MarkupSafe, jsonpointer, json5, idna, h11, fqdn, executing, entrypoints, defusedxml, decorator, charset_normalizer, certifi, babel, attrs, async-lru, asttokens, terminado, stack-data, rfc3339-validator, requests, python-dateutil, matplotlib-inline, jupyter-core, jsonschema, jinja2, jedi, httpcore, debugpy, cffi, anyio, nbformat, jupyter-server-terminals, jupyter-client, ipython, httpx, arrow, argon2-cffi-bindings, isoduration, ipykernel, argon2-cffi, jupyter-events, jupyter-server, notebook-shim, jupyterlab-server, jupyter-lsp, jupyterlab
Successfully installed MarkupSafe-3.0.2 anyio-4.6.0 argon2-cffi-25.1.0 argon2-cffi-bindings-21.2.0.post0 arrow-1.3.0 asttokens-3.0.0 async-lru-2.0.5 attrs-25.3.0 babel-2.17.0.post0 backcall-0.2.0 certifi-2025.8.3 cffi-1.16.0 charset_normalizer-3.4.4 debugpy-1.8.1 decorator-5.1.1 defusedxml-0.7.1.post3 entrypoints-0.4 executing-2.2.1 fastjsonschema-2.21.2 fqdn-1.5.1.post0 h11-0.14.0 httpcore-1.0.4 httpx-0.27.0 idna-3.10.post0 ipykernel-6.9.1.post0 ipython-8.13.2.post0 isoduration-20.11.0.post0 jedi-0.18.2 jinja2-3.1.6 json5-0.9.25 jsonpointer-3.0.0 jsonschema-4.17.3 jupyter-client-7.4.9.post3 jupyter-core-5.8.1 jupyter-events-0.6.3 jupyter-lsp-2.2.4.post0 jupyter-server-2.5.0 jupyter-server-terminals-0.4.4 jupyterlab-4.1.2.post0 jupyterlab-server-2.19.0 matplotlib-inline-0.1.6 nbconvert-7.16.6 nbformat-5.10.4 nest-asyncio-1.5.5 notebook-shim-0.2.3 packaging-25.0 parso-0.8.3 pexpect-4.8.0 pickleshare-0.7.5 platformdirs-4.3.8 prometheus-client-0.14.0 prompt-toolkit-3.0.51 ptyprocess-0.7.0 pure_eval-0.2.3 pycparser-2.20 pygments-2.19.2 pyrsistent-0.20.0 python-dateutil-2.9.0.post0+ibm0 python-json-logger-4.0.0 pyyaml-6.0.2 pyzmq-24.0.1.post0 requests-2.32.5 rfc3339-validator-0.1.4.post0 rfc3986-validator-0.1.1.post0 send2trash-1.8.3 six-1.16.0 sniffio-1.3.1 stack-data-0.6.3 terminado-0.15.0 tornado-6.5.1 traitlets-5.14.3 types-python-dateutil-2.9.0.20240316 uri-template-1.3.0 urllib3-2.5.0 wcwidth-0.2.6 webcolors-24.11.1 websocket-client-1.8.0

[notice] A new release of pip is available: 25.1.1 -> 25.3
[notice] To update, run: pip install --upgrade pip
  

インストールされたパッケージの確認

パッケージのリスト

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # pip list
Package                  Version
------------------------ ----------------
anyio                    4.6.0
argon2-cffi              25.1.0
argon2-cffi-bindings     21.2.0.post0
arrow                    1.3.0
asttokens                3.0.0
async-lru                2.0.5
attrs                    25.3.0
babel                    2.17.0.post0
backcall                 0.2.0
certifi                  2025.8.3
cffi                     1.16.0
charset-normalizer       3.4.4
debugpy                  1.8.1
decorator                5.1.1
defusedxml               0.7.1.post3
entrypoints              0.4
executing                2.2.1
fastjsonschema           2.21.2
fqdn                     1.5.1.post0
h11                      0.14.0
httpcore                 1.0.4
httpx                    0.27.0
idna                     3.10.post0
ipykernel                6.9.1.post0
ipython                  8.13.2.post0
isoduration              20.11.0.post0
jedi                     0.18.2
Jinja2                   3.1.6
json5                    0.9.25
jsonpointer              3.0.0
jsonschema               4.17.3
jupyter_client           7.4.9.post3
jupyter_core             5.8.1
jupyter-events           0.6.3
jupyter-lsp              2.2.4.post0
jupyter_server           2.5.0
jupyter_server_terminals 0.4.4
jupyterlab               4.1.2.post0
jupyterlab_server        2.19.0
MarkupSafe               3.0.2
matplotlib-inline        0.1.6
nbconvert                7.16.6
nbformat                 5.10.4
nest-asyncio             1.5.5
notebook_shim            0.2.3
packaging                25.0
parso                    0.8.3
pexpect                  4.8.0
pickleshare              0.7.5
pip                      25.1.1
platformdirs             4.3.8
prometheus-client        0.14.0
prompt_toolkit           3.0.51
ptyprocess               0.7.0
pure_eval                0.2.3
pycparser                2.20
Pygments                 2.19.2
pyrsistent               0.20.0
python-dateutil          2.9.0.post0+ibm0
python-json-logger       4.0.0
PyYAML                   6.0.2
pyzmq                    24.0.1.post0
requests                 2.32.5
rfc3339_validator        0.1.4.post0
rfc3986_validator        0.1.1.post0
Send2Trash               1.8.3
six                      1.16.0
sniffio                  1.3.1
stack_data               0.6.3
terminado                0.15.0
tornado                  6.5.1
traitlets                5.14.3
types-python-dateutil    2.9.0.20240316
uri-template             1.3.0
urllib3                  2.5.0
wcwidth                  0.2.6
webcolors                24.11.1
websocket-client         1.8.0

サイズ確認

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python/venv312_test05 # du -k -s .
    378828 .

※仮想環境のディレクトリ以下のサイズ: 約380MB

Jupyterバージョン確認

jupyterコマンドによるバージョン確認

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # jupyter --version
Selected Jupyter core packages...
IPython          : 8.13.2.post0
ipykernel        : 6.9.1.post0
ipywidgets       : not installed
jupyter_client   : 7.4.9
jupyter_core     : 5.8.1
jupyter_server   : 2.5.0
jupyterlab       : 4.1.2.post0
nbclient         : not installed
nbconvert        : 7.16.6
nbformat         : 5.10.4
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.14.3

Jupyter Lab起動

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # jupyter lab
[I 2025-12-19 17:36:00.767 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2025-12-19 17:36:00.773 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2025-12-19 17:36:00.779 ServerApp] jupyterlab | extension was successfully linked.
[I 2025-12-19 17:36:01.213 ServerApp] notebook_shim | extension was successfully linked.
[I 2025-12-19 17:36:03.058 ServerApp] notebook_shim | extension was successfully loaded.
[I 2025-12-19 17:36:03.062 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2025-12-19 17:36:03.063 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2025-12-19 17:36:03.064 LabApp] JupyterLab extension loaded from /SYSTEM/tmp/Python/venv312_test05/lib/python3.12/site-packages/jupyterlab
[I 2025-12-19 17:36:03.064 LabApp] JupyterLab application directory is /SYSTEM/tmp/Python/venv312_test05/share/jupyter/lab
[I 2025-12-19 17:36:03.066 LabApp] Extension Manager is 'pypi'.
[I 2025-12-19 17:36:03.121 ServerApp] jupyterlab | extension was successfully loaded.
[I 2025-12-19 17:36:03.125 ServerApp] Serving notebooks from local directory: /SYSTEM/tmp/Python
[I 2025-12-19 17:36:03.125 ServerApp] Jupyter Server 2.5.0 is running at:
[I 2025-12-19 17:36:03.125 ServerApp] http://localhost:8888/lab?token=c5bc6cf856b05c9557b9c02e215ca3f714a74f514c302e53
[I 2025-12-19 17:36:03.125 ServerApp]     http://127.0.0.1:8888/lab?token=c5bc6cf856b05c9557b9c02e215ca3f714a74f514c302e53
[I 2025-12-19 17:36:03.125 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 2025-12-19 17:36:03.141 ServerApp] No web browser found: Error('could not locate runnable browser').
[C 2025-12-19 17:36:03.141 ServerApp]

    To access the server, open this file in a browser:
        file:///u/TAGUCHI/.local/share/jupyter/runtime/jpserver-83886436-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=c5bc6cf856b05c9557b9c02e215ca3f714a74f514c302e53
        http://127.0.0.1:8888/lab?token=c5bc6cf856b05c9557b9c02e215ca3f714a74f514c302e53
[I 2025-12-19 17:36:05.506 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server

Jupyter Labへの接続

Jupyter Labの起動メッセージに、アクセス用のURLが表示されているのでこれを利用します(デフォルトだと8888番ポートでListenする)。
ホスト名がlocalhost(127.0.0.1)となっていますが、基本的にUSS上で利用できるブラウザは無いので、PC上のブラウザからアクセスすることになります。つまり、ブラウザを起動するPCからz/OS(USS)に対するTCP/IP接続についてポート8888に対するHTTP通信が行われることになりますので、この通信が許可されている必要があります。
z/OS環境はネットワークのアクセスがかなり制限されていることが多いですので、ここでも問題になる可能性があります。

ネットワークの問題がクリアされている前提で、PCからz/OS上のJupyter Labにアクセスしてみます。
(URLはJupyter Labの起動ログに出力されているものを使用し、ホスト名(localhost)部分は環境に合わせて変更します。)

image.png

このようにブラウザからJupyter Labに接続できることが確認できました。
あとは通常のJupyter Labと同じようにノートブックの編集やテストができるはず。

追加確認

Jupyter Lab以外のパッケージもインストールして、それらのパッケージを使用したスクリプトがJupyter Lab上で実行できるか、というところまでを試してみたいと思います。
ここでは、pandas, numpyを追加してみます。

パッケージ追加

requirementsファイル作成

requirements_additional.txt
#####
#
# Python AI Toolkit for IBM z/OS
#
# This is the complete list of packages that make up the Python AI
# Toolkit for IBM z/OS.
#
# Example use:  pip install --no-deps -r <toolkit_requirements.txt>
#
# pip command options:
--index-url https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/simple
#NAME?
#--require-hashes
--only-binary :all:

#
# This requirements file was generated for a cp312 environment.
#

setuptools==80.9.0.post20250718
pandas==2.3.0
numpy==2.0.2

上のrequirementsファイルをもとに、Python仮想環境にpandas, numpyをインストール。

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # pip install -r requirements_additional.txt
adding trusted host: 'downloads.pyaitoolkit.ibm.net' (from line 12 of requirements_additional.txt)
Looking in indexes: https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/simple
Collecting setuptools==80.9.0.post20250718 (from -r requirements_additional.txt (line 20))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/setuptools/80.9.0.post20250718/setuptools-80.9.0.post20250718-py3-none-any.whl (1.4 MB)
     qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 1.4/1.4 MB 3.1 MB/s eta 0:00:00
Collecting pandas==2.3.0 (from -r requirements_additional.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/pandas/2.3.0/pandas-2.3.0-cp312-none-any.whl (19.2 MB)
     qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 19.2/19.2 MB 14.1 MB/s eta 0:00:00
Collecting numpy==2.0.2 (from -r requirements_additional.txt (line 22))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/numpy/2.0.2/numpy-2.0.2-cp312-none-any.whl (10.1 MB)
     qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 10.1/10.1 MB 13.9 MB/s eta 0:00:00
Requirement already satisfied: python-dateutil>=2.8.2 in ./venv312_test05/lib/python3.12/site-packages (from pandas==2.3.0->-r requirements_additional.txt (line 21)) (2.9.0.post0+ibm0)
Collecting pytz>=2020.1 (from pandas==2.3.0->-r requirements_additional.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/pytz/2025.2/pytz-2025.2-py3-none-any.whl (587 kB)
     qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq 587.7/587.7 kB 7.2 MB/s eta 0:00:00
Collecting tzdata>=2022.7 (from pandas==2.3.0->-r requirements_additional.txt (line 21))
  Downloading https://downloads.pyaitoolkit.ibm.net/repository/python_ai_toolkit_zos/packages/tzdata/2025.2/tzdata-2025.2-py2.py3-none-any.whl (358 kB)
Requirement already satisfied: defusedxml in ./venv312_test05/lib/python3.12/site-packages (from pandas==2.3.0->-r requirements_additional.txt (line 21)) (0.7.1.post3)
Requirement already satisfied: six>=1.5 in ./venv312_test05/lib/python3.12/site-packages (from python-dateutil>=2.8.2->pandas==2.3.0->-r requirements_additional.txt (line 21)) (1.16.0)
Installing collected packages: pytz, tzdata, setuptools, numpy, pandas
Successfully installed numpy-2.0.2 pandas-2.3.0 pytz-2025.2 setuptools-80.9.0.post20250718 tzdata-2025.2

[notice] A new release of pip is available: 25.1.1 -> 25.3
[notice] To update, run: pip install --upgrade pip

パッケージ確認

(venv312_test05) TAGUCHI:/SYSTEM/tmp/Python # pip list
Package                  Version
------------------------ -------------------
anyio                    4.6.0
argon2-cffi              25.1.0
argon2-cffi-bindings     21.2.0.post0
arrow                    1.3.0
asttokens                3.0.0
async-lru                2.0.5
attrs                    25.3.0
babel                    2.17.0.post0
backcall                 0.2.0
certifi                  2025.8.3
cffi                     1.16.0
charset-normalizer       3.4.4
debugpy                  1.8.1
decorator                5.1.1
defusedxml               0.7.1.post3
entrypoints              0.4
executing                2.2.1
fastjsonschema           2.21.2
fqdn                     1.5.1.post0
h11                      0.14.0
httpcore                 1.0.4
httpx                    0.27.0
idna                     3.10.post0
ipykernel                6.9.1.post0
ipython                  8.13.2.post0
isoduration              20.11.0.post0
jedi                     0.18.2
Jinja2                   3.1.6
json5                    0.9.25
jsonpointer              3.0.0
jsonschema               4.17.3
jupyter_client           7.4.9.post3
jupyter_core             5.8.1
jupyter-events           0.6.3
jupyter-lsp              2.2.4.post0
jupyter_server           2.5.0
jupyter_server_terminals 0.4.4
jupyterlab               4.1.2.post0
jupyterlab_server        2.19.0
MarkupSafe               3.0.2
matplotlib-inline        0.1.6
nbconvert                7.16.6
nbformat                 5.10.4
nest-asyncio             1.5.5
notebook_shim            0.2.3
numpy                    2.0.2
packaging                25.0
pandas                   2.3.0
parso                    0.8.3
pexpect                  4.8.0
pickleshare              0.7.5
pip                      25.1.1
platformdirs             4.3.8
prometheus-client        0.14.0
prompt_toolkit           3.0.51
ptyprocess               0.7.0
pure_eval                0.2.3
pycparser                2.20
Pygments                 2.19.2
pyrsistent               0.20.0
python-dateutil          2.9.0.post0+ibm0
python-json-logger       4.0.0
pytz                     2025.2
PyYAML                   6.0.2
pyzmq                    24.0.1.post0
requests                 2.32.5
rfc3339_validator        0.1.4.post0
rfc3986_validator        0.1.1.post0
Send2Trash               1.8.3
setuptools               80.9.0.post20250718
six                      1.16.0
sniffio                  1.3.1
stack_data               0.6.3
terminado                0.15.0
tornado                  6.5.1
traitlets                5.14.3
types-python-dateutil    2.9.0.20240316
tzdata                   2025.2
uri-template             1.3.0
urllib3                  2.5.0
wcwidth                  0.2.6
webcolors                24.11.1
websocket-client         1.8.0

Jupyter Labでのノートブック稼働検証

pandas, numpyを使用する単純なサンプルのノートブックを作成し、z/OS上のJupyter Labで動かしてみます。

image.png

PC上のJupyter Labと同じ操作感でスクリプトの作成、検証が実施できました!

補足

以前z/OS上でJupyter Labを動かそうとしたら、Babelという依存関係パッケージに不具合がありうまく動かない事象がありましたが、Babel 2.17以降で修正されています。

参考:
python_ai_toolkit_zos - issue #65 Babel package on z/OS missing global.dat file causing JupyterLab startup failure

最新版のパッケージを使っていれば問題ないはずですので念のためご確認ください。

おわりに

Jupyter Labは基本的にシングル・ユーザーで利用することを目的としたもののようなので、サーバー上で稼働させて動かすというのはあまり想定していないのかもしれませんが、手っ取り早くPython for z/OSの開発環境として利用できそうだと思い試してみました。
複数ユーザーを想定したサーバーを立てたい場合は、JupyterHubというユーザー認証機能などが付与されたJupyterサーバー機能を提供するパッケージがあるようなので、そちらを検討するのがよさそうです。ちなみにJupyterHubというパッケージもPython AI Toolkit for IBM z/OSで提供されています。時間があればゆくゆくはその辺も試してみたいところです。

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?