Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Install Python on Windows, macOS, Linux

Learn how to install python on Windows, macOS, Linux with clear steps, practical tips, and troubleshooting guidance.

Table of Contents

This step-by-step guide explains how to install python on Windows, macOS, Linux. It covers the required setup, the main actions, and the checks that help prevent common problems.

What is Python? Why choose Python?

Below is a guide to installing Python on your computer, specific to each operating system.

How to Install and Run Python on Windows

Download Python here: HTTPS: //www. Python. Org/downloads/, select the version you need, in this article we choose Python 3. 6.

Double select the downloaded file to install. There are 2 options here, you can choose one to install.

  • Install Now: Default install Python to C drive, built-in IDLE (provides a graphical interface to work with Python), pip and documents, create shortchut, .
  • Customize installation: Allows you to select the required installation location and features.

Open IDLE. To create a new file in IDLE select File> New Windows or press Ctrl + N.

Copy the Python code:

print("Xin chào!")

Open the file you just created, then press Ctrl + S to save. The file will have a extension called. Py, give it a name, such as: TipsMake-python. Py.

Select Run> Run module or F5 to see the result.

It is very simple and easy, isn't it? Now you have finished running the first Python program already.

How to Install and Run Python on Ubuntu

Install the following denpendency:

$ sudo apt-get install build-essential checkinstall $ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Download Python here: HTTPS: //www. Python. Org/downloads/

In the terminal, open the directory containing the downloaded file and run the following command to extract the file. The file name will vary depending on the version you downloaded.

$ tar -xvf Python-3.6.2.tgz

Open the unzipped folder, enter the command:

$ cd Python-3.6.0

Execute the following commands to compile Python source code on Ubuntu.

$ ./configure 
 $ make 
 $ make install

If you are a new user, you should install Sublime Text on your computer to write Python code on Linux. Enter the following command to install:

$ sudo add-apt-repository -y ppa:webupd8team/sublime-text-2 
 $ sudo apt-get update 
 $ sudo apt-get install sublime-text

Open Sublime Text, go to File> New File or press Ctrl + N to create a new file.

Save the file with the option name, such as TipsMake-python. Py

Write the code and save it:

print("Xin chào!")

Go to Tool> Build (Ctrl + B) and you will see the results of the command line at the bottom of the Sublime Text window.

And so, you've just finished running your first Python program on Ubuntu.

How to Install and Run Python on macOS

Download Python: HTTPS: //www. Python. Org/downloads/

Open the downloaded file to install according to the instructions, a successful installation message appears when finished

You can use your favorite code-writing app or use Sublime Text (a tool that many programmers love).

Open up your code editor, create a new file, save with the extension. Py

Write the following code and save:

print("Xin chào!")

Depending on your code editor that the command to run the code will be different, for Sublime Text press Ctrl + B to see the results when running the command.

So here you have to run the first Python command yourself.

Let's learn another simple program on Python before we start getting used to the basic components of this programming language.

Next article: Keywords and identifiers in Python

FAQ

What should I check before following these steps?

Confirm device and software compatibility, save important data, and make sure you have the required permissions, files, and account access.

Why might the process not work?

Common causes include outdated software, missing permissions, incompatible hardware, an unstable connection, or completing a step in the wrong order.

Can I undo the changes if necessary?

That depends on the tool or setting. Use built-in restore options when available, keep a backup, and record the original configuration first.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.