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

Both the OML4Py server and client installations for an on-premises Oracle 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, 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.1.0 or later version is required to invoke vector database SQL APIs in 23ai.

Use pip3.12 to install the supporting packages. For OML4Py client installation of all the packages, run the following command, specifying the package:

pip3.12 install packagename

These command installs the required Python packages for on-premises OML4Py client:

pip3.12 install pandas==2.1.1
pip3.12 install setuptools==68.0.0
pip3.12 install scipy==1.12.0
pip3.12 install matplotlib==3.8.4
pip3.12 install oracledb==2.2.0
pip3.12 install scikit-learn==1.4.1.post1
pip3.12 install numpy==1.26.4
pip3.12 install onnxruntime==1.17.0
pip3.12 install onnxruntime-extensions==0.10.1
pip3.12 install onnx==1.16.0
pip3.12 install --extra-index-url https://download.pytorch.org/whl/cpu torch==2.2.0+cpu
pip3.12 install transformers==4.38.1
pip3.12 install sentencepiece==0.2.0

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. Run the following command, specifying the package and target directory, $ORACLE_HOME/oml4py/modules:

pip3.12 install packagename --target=$ORACLE_HOME/oml4py/modules

These command installs the required packages:

pip3.12 install pandas==2.1.1--target=$ORACLE_HOME/oml4py/modules
pip3.12 install setuptools==68.0.0 --target=$ORACLE_HOME/oml4py/modules
pip3.12 install scipy==1.12.0 --target=$ORACLE_HOME/oml4py/modules
pip3.12 install matplotlib==3.8.4 --target=$ORACLE_HOME/oml4py/modules
pip3.12 install oracledb==2.2.0 --target=$ORACLE_HOME/oml4py/modulesdules
pip3.12 install joblib==1.2.0 --target=$ORACLE_HOME/oml4py/modules
pip3.12 install scikit-learn==1.4.1.post1 --no-deps --target=$ORACLE_HOME/oml4py/modules
pip3.12 install numpy==1.26.4 --target=$ORACLE_HOME/oml4py/modules

Verify the Package Installation

Load the packages below to ensure they have been installed successfully. Start Python and run the following commands:
python3
Python 3.12.0 (default, Feb 22 2022, 15:13:36)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44.0.3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import numpy
import pandas
import scipy
import matplotlib
import oracledb
import sklearn

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