To install Python on Windows 11 or 10, Linux Ubuntu 22.04 and Mac OS, In Windows you can download and install Python with the GUI installer and cmd, or in Mac OS you can install it with the help of GUI installer and command prompt, and in Linux Ubuntu, you can install it from the command line itself.
Here are some options on how to install Python via command line or GUI installer on Windows 11|10, Linux Ubuntu 22.04 and Mac OS as well as how to create the first program in Python:
Option 1. Download and Install Python on Mac OS X
In Mac OS system, it is very easy to download and install Python using gui installer, here are some steps, that you can use in your Mac OS system to install it:
Step 1: Go to the official python website https://www.python.org/, python, and Download Python lastest version.
Step 2: Double-click the Download exe installer.
Step 3: Follow the instructions of installer prompt.
Step 4: Click to finish and get ready to use.
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, to create a first python program into it.
Option 2. Install Python in Linux Ubuntu 22.04 via Terminal
In Linux Ubuntu systems, it is very easiest way to install Python, Simply open terminal window and type apt-get install python 3.11
command, and press enter, You can do something like this:
Step 1: Press ctrl+alt+t, To open command line or terminal.
Step 2: Update system, Simply use sudo apt-get update
command on terminal window to update dependencies in your system:
Step 3: Install Python, To type sudo apt-get install python 3.11
command on terminal window and press enter, it will install it.
Step 4: Verify Installation, To verify that Python is installed on your system, you can use the python -v
command.
Option 3. Download and Install Python on Windows 11 | 10
Even on Windows, it is very easy to install Python with a GUI installer, here are some steps to help you install Python on Windows:
Step 1: Go to official python website: https://www.python.org/, and Download Python lastest version.
Step 2: Double-click on the downloaded file.
Step 3: Installer prompt opened, Follow the instructions to install it.
Step 4: Click on finish button on prompt.
Step 5: Ready to use python on windows.
Create first Hello world program in python
Here are some steps to 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 or Terminal Windows
In this step, we will run the hello.py file using the following python command:
python hello.py
Output
You will see the output of hello world program on your command prompt (CLI OR CMD):
Hello, World!
Conclusion
That’s it; You learned how to install Python
using the command prompt or Git installer on 3 different operating systems such as Mac OS, Windows 11, and Linux Ubuntu.
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!