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.2.0 or later version is required to invoke vector
                                database SQL APIs in 23ai.
                  These steps outline how to install the required Python packages for an on-premises OML4Py client:
- 
                        
                        Create a file namedrequirements.txtcontaining the following content:--extra-index-url https://download.pytorch.org/whl/cpu pandas==2.1.1 setuptools==68.0.0 scipy==1.12.0 matplotlib==3.8.4 oracledb==2.2.0 scikit-learn==1.4.1.post1 numpy==1.26.4 onnxruntime==1.17.0 onnxruntime-extensions==0.10.1 onnx==1.16.0 torch==2.2.0 transformers==4.38.1 sentencepiece==0.2.0
- 
                        
                        Install the packages with requirements.txt.pip3.12 install -r requirements.txt
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.1.1 setuptools==68.0.0 scipy==1.12.0 matplotlib==3.8.4 oracledb==2.2.0 joblib==1.3.2 scikit-learn==1.4.1.post1 numpy==1.26.4
- 
                        
                        Install the packages withrequirements2.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
python3Python 3.12.3 (main, Aug 14 2024, 15:13:51) [GCC 8.5.0 20210514 (Red
Hat 8.5.0-18.0.6)] on linux
Type "help", "copyright", "credits" or "license" for more information.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 for On-Premises Databases