4.2.1 Commands Summary for Building and Installing Python for Linux for On-Premises Databases
The commands used to build and install Python for Linux for On-Premises Databases are listed in the following example.
Example 4-1 Build and Install Python for Linux for On-Premises Databases
wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz
mkdir -p /home/user/python
tar -xvzf Python-3.12.0.tgz --strip-components=1 -C /home/user/python
cd /home/user/python
sudo yum install perl-Env libffi-devel openssl openssl-devel tk-devel xz-devel zlib-devel bzip2-devel readline-devel libuuid-devel ncurses-devel
cd /home/user/python
./configure --enable-shared --prefix=/home/user/python
make clean; make
make altinstall
export PYTHONHOME=/home/user/python
export PATH=$PYTHONHOME/bin:$PATH
export LD_LIBRARY_PATH=$PYTHONHOME/lib:$LD_LIBRARY_PATH
cd /home/user/python/bin
ln -s python3.12 python3