Installation of Python
To use Python, we must first install it on our computer. Python can run on different operating systems like Windows, macOS, and Linux. Here is a simple step-by-step guide for each platform.
1. Installing Python on Windows
- Go to the official website: www.python.org
- Click on the "Downloads" tab and choose "Python for Windows".
- Download the latest version (e.g., Python 3.12).
- Run the installer file.
- Important: Check the box that says "Add Python to PATH".
- Click on Install Now.
-
After installation, open the Command Prompt and type:
C:\Users\ShikshaSanchar> python --version
It should show the installed version.
2. Installing Python on macOS
- Go to www.python.org.
- Click on "Downloads" and choose "Python for macOS".
- Download the .pkg installer file and run it.
- Follow the installation steps.
-
Open the
Terminal
on MacOS and check the installed Python version:$ python3 --version
3. Installing Python on Linux
Most Linux systems already have Python pre-installed. But if it's not available, you can install it manually using the terminal.
$ sudo apt update
$ sudo apt install python3
$ python3 --version
This will update the package list, install Python 3, and then confirm the installation by showing the version number.
4. Online Python Interpreters (No Installation)
If you don’t want to install anything, you can also use online interpreters to run Python code:
This is useful for practicing and testing small programs without installing Python.
5. Verifying Installation or Check Python Version
After installing Python, you can check the version by typing the following command in your Command Prompt or Terminal:
C:\Users\ShikshaSanchar> python --version
Python 3.10.4
C:\Users\ShikshaSanchar> python3 --version
Python 3.10.4
Note: On some systems like macOS or Linux, you may need to use python3 instead of python.
If Python is installed correctly, it will show the version number.