Here is the step-by-step process to install Python on your system
1. Download Python
- Visit the official Python website: https://www.python.org/downloads/.
- Download the latest stable version of Python for your operating system (Windows, macOS, or Linux).
2. Install Python
On Windows:
- Run the downloaded
.exe
file. - Check the box “Add Python to PATH” (important for running Python from the command line).
- Select Install Now to install Python with default settings, or choose Customize installation for advanced options.
- Wait for the installation to complete.
On macOS:
- Open the downloaded
.pkg
file. - Follow the installation instructions and install Python on your system.
- macOS often comes with Python pre-installed, but you may need to install a newer version.
On Linux:
- Open the terminal and use your package manager to install Python:
- Ubuntu/Debian:
sudo apt update
sudo apt install python3
Fedora:
sudo dnf install python3
Arch Linux:
sudo pacman -S python
3. Verify Python Installation
Once installed, verify the Python version to ensure it was installed correctly:
python --version
or
python3 --version
4. Install pip (Python Package Manager)
Pip often comes bundled with Python. To check if pip is installed, run:
pip --version
If pip is missing, install it using:
python -m ensurepip --upgrade
5. Configure Environment Variables (Windows Only)
If you didn’t check “Add Python to PATH” during installation, you need to manually add Python to your system’s environment variables:
- Search for “Environment Variables” in the Windows search bar.
- Edit the Path variable under “System Variables.”
- Add the directory paths for Python and its
Scripts
folder (e.g.,C:\Python39
andC:\Python39\Scripts
).
6. Install a Code Editor (Optional but Recommended)
To write Python code efficiently, install a code editor like:
- Visual Studio Code (Download here)
- PyCharm (Download here)