In this post, we will learn how to install Python in Windows, Linux, and Mac systems.
We will find the easiest way to run Python and also run first hello-world program on your computer (Windows, Mac OS X or Linux) in this post.
Install Python on Windows 11|10, Linux, Mac
- Install and Run Python in Mac OS X
- Install and Run Python in Linux (Ubuntu)
- Install and Run Python in Windows 11|10
1. Install and Run Python in Mac OS X
Follow the steps given below and install Python in your Mac OS X system:
- Go to Download https://www.python.org/, python official website and Download Python lastest version. Because you may see different version on python.org.
- When Python is fully downloaded, open the package and follow the instructions. You will see the “Installation was successful” message when Python is successfully installed.
- After this, download a good text editor in your system. Such as Sublime text editor, visual text editor, pycharm text editor and as you want
2. Install and Run Python in Linux (Ubuntu)
Follow the steps given below and install Python in your Linux (Ubuntu) system:
- Go to your command prompt and update dependencies, so use the following command to update dependencies in your system:
- apt-get update
- After that, Install Python in your system. So use the following command to install python in your linux system:
- apt-get install python 3.9
- After this, download a good text editor in your system. Such as Sublime text editor, visual text editor, pycharm text editor and as you want
3. Install and Run Python in Windows
Follow the steps given below and install Python in your Windows system:
- Go to Download https://www.python.org/, python official website and Download Python lastest version. Because you may see different version on python.org.
- Next double-click on the downloaded file and follow the instructions to install it. When it successfully install. You will see the “Installation was successful” message when Python is successfully installed.
- After this, download a good text editor in your system. Such as Sublime text editor, visual text editor, pycharm text editor and as you want
Once you have installed Python in your system successfully. After this, we will create the first program Hello World.
For this, whatever you have installed / downloaded your text editor. Open it and follow the instruction given below.
Create first Hello world program in python
Step1: Open your text editor
In this step, open your text editor and create a new file name hello.py
Step2: Update the code into hello.py
Next, update the following hello world program code into your hello.py file:
print('hello world')
Step3: Open command prompt
In this step, we will run the hello.py file using the following python command:
For example C:\Users\Your Name>python hello.py
python hello.py
Output
You will see the output of hello world program on your command prompt (CLI OR CMD):
Hello, World!
I am a novice and I was able to easily install python 3. I did forget to use the ‘sudo’. I chose Sublime as a text editor.
Thanks!