In this tutorial, we will show you how to install Python on openSUSE. Python, a programming language celebrated for its simplicity and readability, has become a cornerstone in the world of technology. Its versatility and wide usage have made it a preferred choice for developers across various domains, from web development to data science, machine learning, and artificial intelligence.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Python programming language on openSUSE.
- A server running one of the following operating systems: openSUSE.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- You will need access to the terminal to execute commands. openSUSE provides the Terminal application for this purpose. It can be found in your Applications menu.
- You’ll need an active internet connection to download Python and its dependencies.
- You’ll need administrative (root) access or a user account with sudo privileges.
Install Python on openSUSE
Step 1. Keeping your system updated ensures you have the latest security patches and software versions, providing a stable base for new installations. In openSUSE, we use the
zypper package manager for this task. Run the following commands to refresh the package list and upgrade your system:
sudo zypper refresh sudo zypper update
Step 2. Checking the Current Python Version
Before installing Python, it’s a good idea to check if it’s already installed on your system. Many Linux distributions, including openSUSE, come with Python pre-installed. To check the current Python version, open a terminal window:
If Python is installed, the terminal will display the version of Python 3 currently installed on your system. If Python is not installed, the terminal will not return any output or it may display an error message.
Step 3. Installing Python on openSUSE.
If Python is not installed on your system or if you want to upgrade to a newer version, you can install it using Zypper. Zypper is the default package manager for openSUSE, allowing you to install, update, and remove software packages. To install Python using Zypper, type the following command into the terminal:
sudo zypper install python3
Enter, you’ll be prompted to enter your password. Type your password and press
Enter again. Zypper will then retrieve the Python package from the openSUSE repositories and install it on your system. During the installation process, Zypper may ask for your confirmation to install additional dependencies. If prompted, press
y and then
Enter to continue with the installation.
In some cases, you may need to install a specific version of Python that’s not available in the openSUSE repositories. For this, you can use version management tools like
pyenv or asdf. These tools allow you to install and manage multiple versions of Python on the same system without conflicts.
To install a specific version of Python using
pyenv, first install
pyenv using the following command:
sudo zypper install pyenv
pyenv is installed, you can install a specific version of Python with the
pyenv install command followed by the version number. For example, to install Python 3.12.1, you would use the following command:
pyenv install 3.12.1
After the installation is complete, you can use the
pyenv global command to set the installed version as the default Python version for your system:
pyenv global 3.12.1
After the installation, it’s important to verify that Python was installed correctly. To do this, use the
python3 --version command again. The terminal should now display the version of Python that you installed. If the version number is displayed, congratulations! You have successfully installed Python on your openSUSE system.
Congratulations! You have successfully installed Python. Thanks for using this tutorial for installing Python programming language on your openSUSE system. For additional or useful information, we recommend you check the official Python website.