All Courses
Install Python

Python can be installed not only on Windows, Linux, and Mac OS, but also on certain other platforms such as IBM AS / 400, iOS, Solaris, and so on. You need to have Python installed to start coding. It’s open-source. So we don’t have to pay anything. To install Python on your local machine, get a copy of the standard distribution of Python software from https: //www.python.org/downloads based on your operating system, hardware architecture, and local computer-based version.

Install Python on Linux

In most cases, your Linux distribution already have Python installed. This way you don’t have to worry about the installation. Check the Python version by entering the below-mentioned command in the
terminal. Then run the command and it will return the Python version.

Python --version

If Python is installed on your PC, you will see the Python version. In addition, if Python is not installed on your PC, run the following command to install it.

sudo apt-get install python3.8

You can specify any version of Python with the above command. However, In this tutorial we use python3.8.

Install Python - Password

When you enter the command, you will be prompted for your PC password. Then enter the password to start the installation. Also, make sure you have internet access to the terminal.

It will take a little time to install Python.

Installing Python

You need to set the PATH variable so that it can be accessed from any directory. To set it, run the following command:

export PATH="$PATH:/usr/bin/local/python3.8"

Check for Python releases after installation. You have successfully installed Python on your PC. Run the python3.8 command to enter interactive mode. To get Python interactive mode, you need to type python3.8 in the terminal. In addition, we will change it soon.

I need to access the interactive shell using python commands, but I can’t access it until I complete the following steps.

First, create a file named Secondly, open the file and paste the text alias in your /home/directory.

Install Python - Configuring environmental variable
.bash alias

Secondly, open the file and paste the text alias

python='/usr/bin/python3.8'.
Install Python - path

Finally, go to the terminal and type python to access the interactive shell. That’s it, and you’re all good to go.

Install Python on Windows

To install Python on a Windows platform, you need to download the installer. You can use web-based installers, executable installers, and embeddable ZIP files to install Python on Windows. Go to https://www.python.org/downloads/windows and download the installer based on your local computer’s hardware architecture.

The web-based installer requires an active internet connection. Therefore, you can also download a standalone executable installer. Go to https://www.python.org/downloads and click the Download Python 3.7.0 button as shown below. (3.7.0 is the latest version at the time of writing this article.)

Download python for windows

This will download python-3.7.0.exe for 32-bit. For 64-bit installers, go to https://www.python.org/downloads/windows and select the appropriate 64-bit installer as shown below.

Downloading windows python files

Download the Windows x86-64 installer executable file and double-click it to launch the Python installer wizard as shown below.

path configuration

Installation is a simple wizard-based process. As you can see in the image above, the default installation folder is C:\Users\{UserName}\AppData\Local\Programs\Python\Python37 for Python 3.7.0 64-bit. Select the Add Python 3.7 to PATH check box to allow Python scripts to be executed from any path. You can click Customize Installation to select the installation folder or feature. This leads to the next step in optional features, as shown below.

optional features

Click Next to continue.

location and all users

Under Advanced Options, select Install for All to allow all users of your local computer to run Python scripts. Also, select the installation folder to create a short path to the Python executable (such as C:\python37), keep the remaining choices, and finally click the Install button.

Installation process

After successful installation, you can check the Python installation by opening a command prompt and typAfter successful installation, you can confirm your Python installation by opening a command prompt, typing python –version or python -V, and pressing Enter. If Python was successfully installed, you will see the installed version.

Python Version

Install Python on Mac OS

If you don’t have Python installed on your Mac operating system, follow these steps to install the latest version of Python.

Firstly, go to the download page of the Python official website.

Install Python on Mac

Secondly, click on the Mac OS X to go to the Python versions page.

Download python Mac Os file

Third, click on the latest version of Python 3-Python 3.8.0 to go to the file download page.

Finding versions

Fourth, scroll down to the File section. Click the macOS 64-bit installer to download the file.

Installer file

Finally, when the download is complete, double-click the .pkg file to start the installation.

This blog we installed Python 3.8.0. Therefore, please check your Python version before moving. So run the python –version command to get the Python version.