4.2.1.2 Install the Required Supporting Packages for Linux for On-Premises Databases

Both the OML4Py server and client installations for an on-premises Oracle AI Database require that you also install a set of supporting Python packages, as described below.

Installing required packages on OML4Py client machine

Note:

onnxruntime, onnxruntime-extensions, onnx, torch, transformers, and sentencepiece are to be installed on the client only. onnxruntime, onnxruntime-extensions, onnx, transformers, and sentencepiece support the ONNX conversion feature on the OML4Py client and should installed on the client only. All other packages are installed on both the client and server.

Note:

oracledb 2.2.0 or later version is required to invoke vector database SQL APIs in 26ai.

These steps outline how to install the required Python packages for an on-premises OML4Py client:

  1. There are two options for installing the dependent supporting packages for the OML4Py client. The steps for each option are outlined below:

    • Option 1: Install Packages from oml4py-supporting-linux-x86_64-2.1.1.zip

      Note:

      The torch-2.9.0 package bundled within oml4py-supporting-linux-x86_64-2.1.1.zip requires the GNU C++ standard library (libstdc++.so.6) on your system to be built with GLIBCXX_3.4.29 or newer.If this version is not available, you may encounter an error such as:
      ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by .../torch/lib/libtorch_python.so)
      On Linux, you can check which GLIBCXX versions are supported by running:
      nm -D /lib64/libstdc++.so.6 | grep GLIBCXX
      If your system does not include GLIBCXX_3.4.29 or newer, resolve the issue by copying a compatible libstdc++.so.6 to $PYTHONHOME/lib.The torch-2.9.0 package includes a suitable version in torch/lib/libstdc++.so.6.
      1. Download the file oml4py-supporting-linux-x86_64-2.1.1.zip. Unzip oml4py-supporting-linux-x86_64-2.1.1.zip into a folder named supporting/.

      2. Create a file named requirements.txt with the following content:
        pandas==2.2.3
        setuptools==80.8.0
        scipy==1.14.1
        matplotlib==3.10.0
        oracledb==3.3.0
        scikit-learn==1.6.1
        numpy==2.1.0
        pyarrow==19.0.0
        onnxruntime==1.20.0
        onnxruntime-extensions==0.12.0
        onnx==1.17.0
        torch==2.9.0
        transformers==4.56.1
        sentencepiece==0.2.0
      3. Install the supporting packages listed in requirements.txt by running:
        pip3.13 install --target <install folder> --no-index --find-links=supporting/ --upgrade -r requirements.txt
        Replace <install folder> with your target directory.
    • Option 2: Install Packages from PyPI Repository
      1. Create a file named requirements.txt with the following content:
        --extra-index-url https://download.pytorch.org/whl/cpu
        pandas==2.2.3
        setuptools==80.8.0
        scipy==1.14.1
        matplotlib==3.10.0
        oracledb==3.3.0
        scikit-learn==1.6.1
        numpy==2.1.0
        pyarrow==19.0.0
        onnxruntime==1.20.0
        onnxruntime-extensions==0.14.0
        onnx==1.18.0
        torch==2.9.0
        transformers==4.56.1
        sentencepiece==0.2.1
      2. Install the supporting packages listed in requirements.txt by running:
        pip3.13 install --target <install folder> --upgrade -r requirements.txt --only-binary=:all:
        Replace <install folder> with your target directory.

Installing required packages on OML4Py server machine

On the OML4Py server machine, all these packages must be installed into $ORACLE_HOME/oml4py/modules so they can be detected by the Embedded Python Execution process.

These steps outline how to install the required Python packages for an on-premises OML4Py server:

  1. Create a file named requirements2.txt containing the following content.

    pandas==2.2.3
    setuptools==70.0.0
    scipy==1.14.1
    matplotlib==3.10.0
    oracledb==2.4.1
    joblib==1.4.2
    scikit-learn==1.6.1
    numpy==2.1.0
  2. Install the packages with requirements2.txt. Run the following command, specifying the target directory, $ORACLE_HOME/oml4py/modules:
    pip3.12 install -r requirements2.txt --target=$ORACLE_HOME/oml4py/modules

Verify the Package Installation

Start Python and then load the packages below to ensure they have been installed successfully:
python3.13
Python 3.13.5 (main, Dec 17 2025, 19:37:22) [GCC 8.5.0 20210514 (Red Hat 8.5.0-28.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Load the below packages:

Note:

The libraries onnx, torch, onnxruntime-extensions, transformers, and sentencepiece are installed on the client machine only.
import numpy
import pandas
import scipy
import matplotlib
import oracledb
import sklearn
import onnx
import torch
import onnxruntime_extensions
import transformers
import sentencepiece

If all the packages are installed successfully, no errors will be returned.