| EX | Installation |
🐍 Guide for Python Installation
Step 1: Download and Install Python
-
Go to the Python download page
Visit the official Python website. - Download the appropriate installer
Choose the correct version for your operating system:- Windows:
.exeinstaller (64-bit recommended) - macOS:
.pkginstaller - Linux: Python is often pre-installed. If not, install it via your package manager (
apt,dnf,yum, etc.).
- Windows:
- Start the installation
- Run the downloaded installer.
- Important: Check the box “Add Python to PATH”.
- Click “Install Now” or choose “Customize Installation” if you want to adjust specific options.
- Verify the installation
Open a terminal or command prompt and enter:python --versionor, on some systems:
python3 --versionYou should see output like
Python 3.12.6.
If it doesn’t work, restart your computer and ensure Python is added to your system PATH.
Step 2: Check the Python Path
To confirm which Python version your system is using and where it’s installed, follow these steps:
🔹 Windows
- Open Command Prompt or PowerShell
(PressWin + R, typecmdorpowershell, and press Enter). - Enter the command:
where python - You’ll see one or more paths, for example:
C:\Users\YourName\AppData\Local\Programs\Python\Python311\python.exe C:\Program Files\Python39\python.exeThe first path listed is the default Python interpreter your system uses.
🔹 macOS / Linux
- Open the Terminal.
- Enter one of the following commands:
which python # or, on newer systems: which python3 - Example output:
/usr/bin/python3 /opt/homebrew/bin/python3The displayed path shows the active Python interpreter on your system.
✅ Tip:
To start Python interactively, type:
python
# or
python3
and press Enter.
To exit again, type:
exit()