Python Installation

Python is a powerful and dynamic language. To begin Python programming, you must have the Python programming language installed on your computer. You can install it on the most available operating systems such as Windows, Linux, Unix, macOS, etc. There are various methods of installing Python on different operating systems.

Installing Python on Windows

In Windows, you can install Python in two different ways:

Download Python from the Microsoft Store

To download Python binary language from the Microsoft Store, follow these steps:-

  1. Open Command Prompt, type python in it, and press the enter key.
  2. A Microsoft Store window will automatically prompt and redirect you to the Python store page.
  3. Just press the install button.
  4. Once the Python installation is complete, go to the start menu, and you can find Python in the installed applications list.

Download Python from the Python.org

To install the Python binary language from the official website Python.org, follow these steps:-

  1. Open the link https://www.python.org/downloads/windows/ and download Python's latest release.
  2. It will take you to a web page containing all the new features added in that particular python version. Download the Python installer files by scrolling down to the end of the page.
  3. Download Python, Windows installer (32-bit) or Windows installer (64-bit) as per your system's requirement
  4. After downloading Python, click on the Python installation file.
  5. A setup wizard will pop up. Check the 'Add Python to PATH' checkbox and then Install now.
  6. After installation, click on finish. Check your start menu to find Python in the installed applications list.

To check whether Python installation is successful on Windows, Open the command prompt, type, and run the following command.

			

python -v

		

Open your favourite text editor to write your first Python program, write any Python code, and don't forget to save it with the '.py' extension. You can run the script by typing the command in the command prompt:

python path_to_your_script

Download Python on macOS

You can download Python on macOS from the Official Python Website. Follow these steps:-

  1. Open the Python download link https://www.python.org/downloads/macos/ and go to the latest python release link.
  2. It will redirect you to a web page containing all the new features added in that particular python version. At the end of the page, you will find the installer files.
  3. Click on the macOS 64-bit universal2 installer.
  4. The Python download will start. After downloading, open it.
  5. A Python setup wizard will pop up. Check the 'Add Python to PATH' checkbox and then Install now.
  6. After installation, click on finish. Check your start, and you can find Python in the installed applications list.

For Linux Users

Almost all Linux distributions come with Python pre-installed except for some distributions. Check and upgrade to the latest version. Several package managers are available to install the software on Linux. Use a package manager to install Python. Open the console and type the given command to check the installed version.

			

$ python3 –version

		

If the latest version or release is already installed in the system, then you do not need to update Python, or else you can update or install the newest version using the given commands on Debian or Ubuntu.

To check if Python3 is available for installation.

			

$ sudo add-apt-repository ppa:deadsnakes/ppa

		

Update the environment with the following command.

			

$ sudo apt update

		

Now you can install using the command.

			

$ sudo apt install python3

		

On Centos distribution, use the following commands:

			

$ yum update -y

		
			

$ yum install -y python3

		

For Arch Based Distros, use the following commands:

			

$ yum update -y

		
			

$ sudo pacman -Syu python3

		

For Fedora Based Distros, use the following commands:

			

$ yum update -y

		
			

$ sudo dnf install Python

		

Run an interactive python shell using the given command in the Terminal:

			

python

		

Python code can be run by typing the following command in the Terminal.

			

python path_to_your_script