Configure Python 3.6, 3.7, 3.8 on SUSE12SPS x86_64
Login as root user(using sudo su -) or use sudo command before every steps below
Step 1: Use commands “zypper refresh” to refresh zypper repositories.
zypper refresh
Step 2: Use commands “zypper update” will upgrade all the packages on your system to the latest version.
zypper update -y
Step 3: Check the present python version(In my case it is 3.4.10)
Step 4: Download below packages using below command:
zypper install -y readline-devel sqlite3-devel libbz2-devel zlib-devel libopenssl-devel libffi-devel gcc
As per the requirement, if you want to install python 3.6 use steps (5, 6, 7) or python 3.7 use steps (8, 9, 10) or python 3.8 use steps (11, 12, 13) after that continue from step 14.
Step 5: Download python 3.6 tar file(in root directory) using below command:
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
Step 6: Unzip the tar file using below command:
tar -xvf Python-3.6.3.tar.xz
Step 7: Get into the directory using below command:
cd Python-3.6.3/
Step 8: Download python 3.7 tar file(in root directory) using below command:
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
Step 9: Unzip the tar file using below command:
tar -xvf Python-3.7.4.tar.xz
Step 10: Get into the directory using below command:
cd Python-3.7.4/
Step 11: Download python 3.8 tar file(in root directory) using below command:
wget https://www.python.org/ftp/python/3.8.7/Python-3.8.7.tgz
Step 12: Unzip the tar file using below command:
tar -xvf Python-3.8.7.tgz
Step 13: Get into the directory using below command:
cd Python-3.8.7/
Step 14: Execute the ./configure command as shown below:
./configure
Step 15: Download the make package using below command:
zypper install -y make
Step 16: fire the make command as shown below:
make
Step 17: run the “make install” command command as shown below:
make install
Path Setup For Python
Step 18: Check the existing set path using below command:
echo $PATH
Step 19: use below command in root directory to set the path for python 3.6.3
echo ‘export PATH=”$PATH/root/Python-3.6.3/”’>> ~/.bashrc
source ~/.bashrc
Step 20: Congratulation!, python 3.6 have been set
Step 21: use below command in root directory to set the path for python 3.7.4
echo ‘export PATH=”$PATH/root/Python-3.8.7/”’>> ~/.bashrc
source ~/.bashrc
Step 22: Congratulation!, python 3.7 have been set
Step 23: use below command in root directory to set the path for python 3.8.7
echo ‘export PATH=”$PATH/root/Python-3.8.7/”’>> ~/.bashrc
source ~/.bashrc
Step 24: Congratulation!, python 3.8 have been set
For any query contact - Ashish Kanojia