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:
-
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:
Thetorch-2.9.0package bundled withinoml4py-supporting-linux-x86_64-2.1.1.ziprequires 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 whichGLIBCXXversions are supported by running:
If your system does not includenm -D /lib64/libstdc++.so.6 | grep GLIBCXXGLIBCXX_3.4.29or newer, resolve the issue by copying a compatiblelibstdc++.so.6to$PYTHONHOME/lib.Thetorch-2.9.0package includes a suitable version intorch/lib/libstdc++.so.6.-
Download the file oml4py-supporting-linux-x86_64-2.1.1.zip. Unzip
oml4py-supporting-linux-x86_64-2.1.1.zipinto a folder namedsupporting/. - Create a file named
requirements.txtwith 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 - Install the supporting packages listed in
requirements.txtby running:
Replacepip3.13 install --target <install folder> --no-index --find-links=supporting/ --upgrade -r requirements.txt<install folder>with your target directory.
-
- Option 2: Install Packages from PyPI
Repository
- Create a file named
requirements.txtwith 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 - Install the supporting packages listed in
requirements.txtby running:
Replacepip3.13 install --target <install folder> --upgrade -r requirements.txt --only-binary=:all:<install folder>with your target directory.
- Create a file named
- Option 1: Install Packages from oml4py-supporting-linux-x86_64-2.1.1.zip
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:
-
Create a file named
requirements2.txtcontaining 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 -
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
python3.13Python 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.Note:
The librariesonnx, 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 sentencepieceIf all the packages are installed successfully, no errors will be returned.
- Commands Summary for Installing Required Supporting Packages for Linux for On-Premises Databases
The commands used for installing required supporting packages for linux for On-Premises databases are listed in the following example.
Parent topic: Install OML4Py 2.1.1 for On-Premises Databases