How to install Python on Windows, macOS, Linux

In the previous article, we learned about Python well , the advantages and areas that can use this programming language. To get started with Python, you first need to install Python on the computer you are using, be it Windows, macOS or Linux.

What is Python? Why choose Python?

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

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 click on the downloaded file to install. There are 2 options here, you can choose one to install.

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

How to install Python on Windows, macOS, Linux Picture 1

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

Copy the Python code:

 print("Xin chào!") 

Go to 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: quantrimang-python.py.

How to install Python on Windows, macOS, Linux Picture 2

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

How to install Python on Windows, macOS, Linux Picture 3

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

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, go to 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 

Go to 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 quantrimang-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.

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 will appear when finished

You can use your favorite code-writing application 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

4 ★ | 2 Vote

May be interested

  • How to install macOS in VirtualBoxHow to install macOS in VirtualBox
    with virtualbox, you can install macos on a windows pc. along tipsmake.com learn how to do through the following article offline!
  • How to install Pip in UbuntuHow to install Pip in Ubuntu
    linux has a lot of package managers. ubuntu not only has apt but also many programming languages ​​that come with its own package manager. pip stands for python packages packages and allows you to easily install packages from python package index (pypi).
  • How to Check Python Version on Windows, Mac and LinuxHow to Check Python Version on Windows, Mac and Linux
    to check which version of python is installed on your windows, mac or linux computer, all you have to do is simply run a single command.
  • How to Install Modules for Python 3.X Using Pip in Windows 10How to Install Modules for Python 3.X Using Pip in Windows 10
    if you're a budding computer scientist working with python 3 and want to add functionality and power to your projects that doesn't exist in the base built-in python modules, you may want to try to install external third-party modules and...
  • Making Linux look like macOS with these easy tweaks!Making Linux look like macOS with these easy tweaks!
    you can learn the simple steps needed to make the linux desktop work and look like apple's macos.
  • How to Install ScipyHow to Install Scipy
    this wikihow teaches you how to install the main scipy packages from the scipy library, using windows, mac or linux. scipy is a free and open-source python library with packages optimized and developed for scientific and technical...
  • How to install Linux operating system on MacHow to install Linux operating system on Mac
    if you have a mac and want to explore a new open source operating system, check out the instructions on how to install linux on a mac below.
  • How to install Windows Game on Linux with WinepakHow to install Windows Game on Linux with Winepak
    flatpak is a favorite choice of third-party vendors and proprietary software developers because it allows them to package linux programs once and distribute them on all linux versions.
  • How to install Windows Subsystem for Linux 2 on Windows 10How to install Windows Subsystem for Linux 2 on Windows 10
    on windows 10 2004, microsoft is introducing windows subsystem for linux version 2 (wsl 2), which is a new version of the architecture that allows running linux on the original windows 10 and eventually replaces wsl 1.
  • How to Download and Install macOS on a Virtual Machine Using VirtualBoxHow to Download and Install macOS on a Virtual Machine Using VirtualBox
    macos is very different from windows because this operating system has its own interface, features, application set, and programs. maybe you're considering buying a new computer so you want to try the macos operating system before deciding. you might also really want to try out some apps specific to this operating system. macos can be installed on a windows (or linux) computer using a virtual machine or as a dual boot. today's tipsmake will show you how to install macos on a virtual machine using virtualbox.