5.2.1 DCLIを使用したExadataコンピュート・ノード全体へのPythonのインストール
DCLIを使用してExadataコンピュート・ノード全体にPythonをインストールする手順です。
次のステップでは、Exadata用のPythonのビルドおよびインストールについて説明します。
-
Python Webサイトにアクセスし、Python 3.12.0のXZ compressed source tarballをダウンロードし解凍します。ダウンロードされるファイル名は
Python-3.12.0.tgz
です$ wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz $ tar xvf Python-3.12.0.tgz
-
OML4Pyには、
perl-Env libffi-devel
、openssl
、openssl-devel
、tk-devel
、xz-devel
、zlib-devel
、bzip2-devel
、readline-devel
およびlibuuid-devel
の各ライブラリが存在する必要があります。次のコマンドを使用して、これらのライブラリをインストールします。# dcli -t -g nodes -l root "yum -y install perl-Env libffi-devel openssl openssl-devel tk-devel xz-devel zlib-devel bzip2-devel readline-devel libuuid-devel"
-
各ノードで、PYTHONHOME環境を設定します。
# dcli -t -g nodes -l oracle "export PYTHONHOME=$ORACLE_HOME/python; export PATH=$ORACLE_HOME/python/bin$PATH; export LD_LIBRARY_PATH=$ORACLE_HOME/python/lib:$LD_LIBRARY_PATH; export PIP_REQUIRE_VIRTUALENV=false" # dcli -t -g nodes -l oracle "tar xvfz $ORACLE_HOME/Python-3.12.0.tgz -C $ORACLE_HOME/python" # dcli -t -g nodes -l oracle "cd $ORACLE_HOME/python; ./configure --enable-shared --prefix=$ORACLE_HOME/python" # dcli -t -g nodes -l oracle "cd $ORACLE_HOME/python; make clean; make" # dcli -t -g nodes -l oracle "cd $ORACLE_HOME/python; make altinstall"
-
$PYTHONHOME/bin
ディレクトリにシンボリック・リンクを作成します。これをPython-3.12実行可能ファイルにリンクする必要があります。これは、次のコマンドを使用して実行できます:# dcli -t -g nodes -l oracle "cd $PYTHONHOME/bin" # dcli -t -g nodes -l oracle "ln -s python3.12 python3"
-
環境変数
PYTHONHOME
を設定してPATH
に追加し、環境変数LD_LIBRARY_PATH
を設定します。# dcli -t -g nodes -l oracle "export PYTHONHOME=$ORACLE_HOME/python" # dcli -t -g nodes -l oracle "export PATH=$PYTHONHOME/bin:$PATH" # dcli -t -g nodes -l oracle "export LD_LIBRARY_PATH=$PYTHONHOME/lib:$LD_LIBRARY_PATH" # dcli -t -g nodes -l oracle "export PIP_REQUIRE_VIRTUALENV=false"
-
これで、コマンドpython3を実行してPythonを起動できます。たとえば、次のようになります。
# dcli -t -g nodes -l oracle "python3" exadb01: Python 3.12.0 (default, Feb 10 2022, 14:38:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44.0.3)] on linux Type "help", "copyright", "credits" or "license" for more information. exadb02: Python 3.12.0 (default, Feb 10 2022, 14:38:12) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44.0.3)] on linux Type "help", "copyright", "credits" or "license" for more information.