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?

RHEL8.4 への python3.9 と shipmi の 導入

Posted at

python3.9 の導入

# env LANG=C dnf install @python39/build
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Last metadata expiration check: 0:10:34 ago on Sat Nov  8 19:56:17 2025.
Dependencies resolved.
=======================================================================================================================================
 Package                             Architecture     Version                                         Repository                  Size
=======================================================================================================================================
Installing group/module packages:
 python39                            x86_64           3.9.2-1.module+el8.4.0+10237+bdc77aac           RHEL84-AppStream            32 k
 python39-devel                      x86_64           3.9.2-1.module+el8.4.0+10237+bdc77aac           RHEL84-AppStream           231 k
 python39-rpm-macros                 noarch           3.9.2-1.module+el8.4.0+10237+bdc77aac           RHEL84-AppStream            14 k
Installing dependencies:
 python-rpm-macros                   noarch           3-41.el8                                        RHEL84-AppStream            15 k
 python-srpm-macros                  noarch           3-41.el8                                        RHEL84-AppStream            15 k
 python3-rpm-macros                  noarch           3-41.el8                                        RHEL84-AppStream            14 k
 python39-libs                       x86_64           3.9.2-1.module+el8.4.0+10237+bdc77aac           RHEL84-AppStream           8.1 M
 python39-pip-wheel                  noarch           20.2.4-3.module+el8.4.0+9822+20bf1249           RHEL84-AppStream           1.3 M
 python39-setuptools-wheel           noarch           50.3.2-3.module+el8.4.0+9822+20bf1249           RHEL84-AppStream           497 k
Installing weak dependencies:
 python39-pip                        noarch           20.2.4-3.module+el8.4.0+9822+20bf1249           RHEL84-AppStream           2.0 M
 python39-setuptools                 noarch           50.3.2-3.module+el8.4.0+9822+20bf1249           RHEL84-AppStream           871 k
Installing module profiles:
 python39/build
Enabling module streams:
 python39                                             3.9

Transaction Summary
=======================================================================================================================================
Install  11 Packages

Total download size: 13 M
Installed size: 46 M
Is this ok [y/N]: y
Downloading Packages:
(1/11): python-rpm-macros-3-41.el8.noarch.rpm                                                          826 kB/s |  15 kB     00:00
(2/11): python-srpm-macros-3-41.el8.noarch.rpm                                                         783 kB/s |  15 kB     00:00
(3/11): python3-rpm-macros-3-41.el8.noarch.rpm                                                         707 kB/s |  14 kB     00:00
(4/11): python39-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64.rpm                                       11 MB/s |  32 kB     00:00
(5/11): python39-devel-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64.rpm                                 24 MB/s | 231 kB     00:00
(6/11): python39-pip-wheel-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch.rpm                             68 MB/s | 1.3 MB     00:00
(7/11): python39-rpm-macros-3.9.2-1.module+el8.4.0+10237+bdc77aac.noarch.rpm                           9.6 MB/s |  14 kB     00:00
(8/11): python39-pip-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch.rpm                                   51 MB/s | 2.0 MB     00:00
(9/11): python39-setuptools-wheel-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch.rpm                      63 MB/s | 497 kB     00:00
(10/11): python39-setuptools-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch.rpm                           36 MB/s | 871 kB     00:00
(11/11): python39-libs-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64.rpm                                 80 MB/s | 8.1 MB     00:00
---------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                  103 MB/s |  13 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                               1/1
  Installing       : python39-setuptools-wheel-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch                                       1/11
  Installing       : python39-pip-wheel-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch                                              2/11
  Installing       : python39-libs-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                   3/11
  Installing       : python39-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                        4/11
  Running scriptlet: python39-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                        4/11
  Installing       : python39-setuptools-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch                                             5/11
  Running scriptlet: python39-setuptools-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch                                             5/11
  Installing       : python39-pip-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch                                                    6/11
  Running scriptlet: python39-pip-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch                                                    6/11
  Installing       : python-srpm-macros-3-41.el8.noarch                                                                           7/11
  Installing       : python-rpm-macros-3-41.el8.noarch                                                                            8/11
  Installing       : python3-rpm-macros-3-41.el8.noarch                                                                           9/11
  Installing       : python39-devel-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                 10/11
  Running scriptlet: python39-devel-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                 10/11
  Installing       : python39-rpm-macros-3.9.2-1.module+el8.4.0+10237+bdc77aac.noarch                                            11/11
  Running scriptlet: python39-rpm-macros-3.9.2-1.module+el8.4.0+10237+bdc77aac.noarch                                            11/11
  Verifying        : python-rpm-macros-3-41.el8.noarch                                                                            1/11
  Verifying        : python-srpm-macros-3-41.el8.noarch                                                                           2/11
  Verifying        : python3-rpm-macros-3-41.el8.noarch                                                                           3/11
  Verifying        : python39-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                        4/11
  Verifying        : python39-devel-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                  5/11
  Verifying        : python39-libs-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64                                                   6/11
  Verifying        : python39-pip-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch                                                    7/11
  Verifying        : python39-pip-wheel-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch                                              8/11
  Verifying        : python39-rpm-macros-3.9.2-1.module+el8.4.0+10237+bdc77aac.noarch                                             9/11
  Verifying        : python39-setuptools-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch                                            10/11
  Verifying        : python39-setuptools-wheel-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch                                      11/11
Installed products updated.

Installed:
  python-rpm-macros-3-41.el8.noarch
  python-srpm-macros-3-41.el8.noarch
  python3-rpm-macros-3-41.el8.noarch
  python39-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64
  python39-devel-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64
  python39-libs-3.9.2-1.module+el8.4.0+10237+bdc77aac.x86_64
  python39-pip-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch
  python39-pip-wheel-20.2.4-3.module+el8.4.0+9822+20bf1249.noarch
  python39-rpm-macros-3.9.2-1.module+el8.4.0+10237+bdc77aac.noarch
  python39-setuptools-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch
  python39-setuptools-wheel-50.3.2-3.module+el8.4.0+9822+20bf1249.noarch

Complete!

一般利用向け python を選択

  • RHEL8以降, OSが利用する python と 一般利用の python が,別管理される
  • shipmi が 稼働する python3.9 を 利用
# env LANG=C alternatives --config python

There are 3 programs which provide 'python'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/libexec/no-python
   2           /usr/bin/python3
   3           /usr/bin/python3.9

Enter to keep the current selection[+], or type selection number: 3

pip コマンドを登録

# update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# which pip
/usr/bin/pip

オフライン環境用に shipmi を ダウンロード

# pip download -d /tmp/shipmi/DOWNLOAD shipmi
Collecting shipmi
  Downloading shipmi-3.0.1-py3-none-any.whl (38 kB)
  Saved ./shipmi-3.0.1-py3-none-any.whl
Collecting pyghmi>=1.5.33
  Downloading pyghmi-1.6.6-py3-none-any.whl (284 kB)
     |████████████████████████████████| 284 kB 5.5 MB/s
  Saved ./pyghmi-1.6.6-py3-none-any.whl
Collecting pyzmq>=22.3.0
  Downloading pyzmq-27.1.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (863 kB)
     |████████████████████████████████| 863 kB 11.7 MB/s
  Saved ./pyzmq-27.1.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Collecting cliff>=3.10.0
  Downloading cliff-4.9.1-py3-none-any.whl (84 kB)
     |████████████████████████████████| 84 kB 4.7 MB/s
  Saved ./cliff-4.9.1-py3-none-any.whl
Collecting cryptography>=2.1
  Downloading cryptography-46.0.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.4 MB)
     |████████████████████████████████| 4.4 MB 11.6 MB/s
  Saved ./cryptography-46.0.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Collecting six>=1.10.0
  Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
  Saved ./six-1.17.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.8.1
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
     |████████████████████████████████| 229 kB 12.8 MB/s
  Saved ./python_dateutil-2.9.0.post0-py2.py3-none-any.whl
Collecting stevedore>=2.0.1
  Downloading stevedore-5.5.0-py3-none-any.whl (49 kB)
     |████████████████████████████████| 49 kB 4.7 MB/s
  Saved ./stevedore-5.5.0-py3-none-any.whl
Collecting PyYAML>=3.12
  Downloading pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (750 kB)
     |████████████████████████████████| 750 kB 10.9 MB/s
  Saved ./pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Collecting importlib-metadata>=4.4; python_version < "3.10"
  Downloading importlib_metadata-8.7.0-py3-none-any.whl (27 kB)
  Saved ./importlib_metadata-8.7.0-py3-none-any.whl
Collecting PrettyTable>=0.7.2
  Downloading prettytable-3.16.0-py3-none-any.whl (33 kB)
  Saved ./prettytable-3.16.0-py3-none-any.whl
Collecting autopage>=0.4.0
  Downloading autopage-0.5.2-py3-none-any.whl (30 kB)
  Saved ./autopage-0.5.2-py3-none-any.whl
Collecting cmd2>=1.0.0
  Downloading cmd2-2.7.0-py3-none-any.whl (154 kB)
     |████████████████████████████████| 154 kB 11.5 MB/s
  Saved ./cmd2-2.7.0-py3-none-any.whl
Collecting typing-extensions>=4.13.2; python_full_version < "3.11"
  Downloading typing_extensions-4.15.0-py3-none-any.whl (44 kB)
     |████████████████████████████████| 44 kB 3.1 MB/s
  Saved ./typing_extensions-4.15.0-py3-none-any.whl
Collecting cffi>=2.0.0; python_full_version >= "3.9" and platform_python_implementation != "PyPy"
  Downloading cffi-2.0.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (216 kB)
     |████████████████████████████████| 216 kB 12.2 MB/s
  Saved ./cffi-2.0.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Collecting zipp>=3.20
  Downloading zipp-3.23.0-py3-none-any.whl (10 kB)
  Saved ./zipp-3.23.0-py3-none-any.whl
Collecting wcwidth
  Downloading wcwidth-0.2.14-py2.py3-none-any.whl (37 kB)
  Saved ./wcwidth-0.2.14-py2.py3-none-any.whl
Collecting rich-argparse>=1.7.1
  Downloading rich_argparse-1.7.2-py3-none-any.whl (25 kB)
  Saved ./rich_argparse-1.7.2-py3-none-any.whl
Collecting pyperclip>=1.8
  Downloading pyperclip-1.11.0-py3-none-any.whl (11 kB)
  Saved ./pyperclip-1.11.0-py3-none-any.whl
Collecting pycparser; implementation_name != "PyPy"
  Downloading pycparser-2.23-py3-none-any.whl (118 kB)
     |████████████████████████████████| 118 kB 11.9 MB/s
  Saved ./pycparser-2.23-py3-none-any.whl
Collecting rich>=11.0.0
  Downloading rich-14.2.0-py3-none-any.whl (243 kB)
     |████████████████████████████████| 243 kB 8.0 MB/s
  Saved ./rich-14.2.0-py3-none-any.whl
Collecting pygments<3.0.0,>=2.13.0
  Downloading pygments-2.19.2-py3-none-any.whl (1.2 MB)
     |████████████████████████████████| 1.2 MB 12.4 MB/s
  Saved ./pygments-2.19.2-py3-none-any.whl
Collecting markdown-it-py>=2.2.0
  Downloading markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
     |████████████████████████████████| 87 kB 7.5 MB/s
  Saved ./markdown_it_py-3.0.0-py3-none-any.whl
Collecting mdurl~=0.1
  Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)
  Saved ./mdurl-0.1.2-py3-none-any.whl
Successfully downloaded shipmi pyghmi pyzmq cliff cryptography six python-dateutil stevedore PyYAML importlib-metadata PrettyTable autopage cmd2 typing-extensions cffi zipp wcwidth rich-argparse pyperclip pycparser rich pygments markdown-it-py mdurl

Python仮想環境を準備

  • python -m venv コマンドは, カレントワーキングディレクトリ下に, python ファイルが配置される
  • 独立したPython環境を作成する.(OSの正常な動作に不可欠なシステム用Pythonとの衝突を回避し,OSの安定稼働を担保する為)
# cd {仮想環境を配置するディレクトリへ移動}
# python -m venv shIPMI_python_env

仮想環境へ shipmi を install

  • 準備した仮想環境「shIPMI_python_env」へ shipmi を導入
# source shIPMI_python_env/bin/activate
# pip install --no-index --find-links /tmp/shipmi/DOWNLOAD shipmi
Looking in links: /tmp/shipmi/DOWNLOAD
Processing /tmp/shipmi/DOWNLOAD/shipmi-3.0.1-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/cliff-4.9.1-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/pyghmi-1.6.6-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/pyzmq-27.1.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Processing /tmp/shipmi/DOWNLOAD/prettytable-3.16.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/autopage-0.5.2-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Processing /tmp/shipmi/DOWNLOAD/importlib_metadata-8.7.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/cmd2-2.7.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/stevedore-5.5.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/six-1.17.0-py2.py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/python_dateutil-2.9.0.post0-py2.py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/cryptography-46.0.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Processing /tmp/shipmi/DOWNLOAD/wcwidth-0.2.14-py2.py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/zipp-3.23.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/rich_argparse-1.7.2-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/pyperclip-1.11.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/cffi-2.0.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Processing /tmp/shipmi/DOWNLOAD/typing_extensions-4.15.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/rich-14.2.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/pycparser-2.23-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/pygments-2.19.2-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/markdown_it_py-3.0.0-py3-none-any.whl
Processing /tmp/shipmi/DOWNLOAD/mdurl-0.1.2-py3-none-any.whl
Installing collected packages: wcwidth, PrettyTable, autopage, PyYAML, zipp, importlib-metadata, pygments, mdurl, markdown-it-py, rich, rich-argparse, pyperclip, cmd2, stevedore, cliff, six, python-dateutil, pycparser, cffi, typing-extensions, cryptography, pyghmi, pyzmq, shipmi
Successfully installed PrettyTable-3.16.0 PyYAML-6.0.3 autopage-0.5.2 cffi-2.0.0 cliff-4.9.1 cmd2-2.7.0 cryptography-46.0.3 importlib-metadata-8.7.0 markdown-it-py-3.0.0 mdurl-0.1.2 pycparser-2.23 pyghmi-1.6.6 pygments-2.19.2 pyperclip-1.11.0 python-dateutil-2.9.0.post0 pyzmq-27.1.0 rich-14.2.0 rich-argparse-1.7.2 shipmi-3.0.1 six-1.17.0 stevedore-5.5.0 typing-extensions-4.15.0 wcwidth-0.2.14 zipp-3.23.0

(shIPMI_python_env) [root@your-host-name Python-vm]# deactivate

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?