What is Python?
Python is a versatile, interpreted, object-oriented, high-level programming language with dynamic semantics. It offers high-level built-in data structures and utilizes dynamic typing and dynamic binding, making it extremely appealing for quick application development. Additionally, it is often used as a scripting or glue language to connect different existing components.
Install Python
This knowledge base article provides a comprehensive guide on how to install Python on various operating systems, including Windows, Mac, and Linux. It includes detailed, step-by-step instructions tailored for each platform to ensure a smooth installation process. Once you’ve successfully installed Python, it’s crucial to check the installed version. This verification step helps confirm that the installation was completed without any issues, allowing you to start using Python with confidence. For further information and detailed instructions, please refer to the official Python documentation.
Windows
- Download the Python installer.
- Execute the Python installer, and proceed with Next and Finish prompts to install Python.
After installing Python on your Windows operating system, you’ll want to verify the installation by using the following commands.
# Check Python version.
$ python --version
Mac
- Download the Python package.
- Execute the Python package, and proceed with Continue and Install prompts to install Python.
After installing Python on your Mac operating system, you’ll want to verify the installation by using the following commands.
# Check Python version.
$ python --version
Linux (RPM)
You can use the following commands to install Python in RPM-based Linux operating systems such as CentOS Linux, Red Hat Linux, Fedora Linux, Amazon Linux, Alma Linux, Rocky Linux, etc., or any other similar equivalents.
# Install Python.
$ sudo yum install python3.12
# Set Python 3.12 as default interpreter and Python 3.9 as fallback interpreter.
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.12 2
# List Python versions.
$ sudo update-alternatives --list python
# Check Python version.
$ python --version
Linux (Debian)
You can use the following commands to install Python in Debian-based Linux operating systems such as Ubuntu Linux, Mint Linux, Kali Linux, Kubuntu Linux, etc., or any other similar equivalents.
# Install Python.
$ sudo apt install python3.12
# Set Python 3.12 as default interpreter.
$ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1
# List Python versions.
$ sudo update-alternatives --list python
# Check Python version.
$ python --version