Installation
Installation process
Windows
To install Python on a Windows system, follow these steps:
Visit the Official Python Website Open your web browser and go to the official Python website: python.org.
Navigate to the Downloads Section Once on the website, click on the “Downloads” tab in the navigation bar. The website should automatically detect that you are using Windows and suggest the latest version of Python compatible with your system.
Download the Latest Python Installer Click the download button to download the latest Python installer for Windows. The installer will be a
.exe
file.Run the Installer Locate the downloaded installer file (usually in your “Downloads” folder) and double-click it to run the installer.
Check “Add Python to PATH” During the installation process, you’ll see an option to “Add Python to PATH.” Ensure this box is checked. This step is crucial as it allows you to run Python from the command line without needing to specify the full path to the Python executable.
Select “Install Now” Click the “Install Now” button to proceed with the installation. The installer will install Python, along with pip (Python’s package manager), and other necessary tools.
Verify Installation After the installation is complete, you can verify that Python is installed correctly. Open the Command Prompt (you can search for “cmd” in the Start menu) and type:
MacOS
To install Python on a MacOS system, follow these steps:
Visit the Official Python Website Open Safari or your preferred web browser and go to the official Python website: python.org.
Navigate to the Downloads Section Once on the website, click on the “Downloads” tab in the navigation bar. The website should automatically detect that you are using Windows and suggest the latest version of Python compatible with your system.
Download the Latest Python Installer Click the download button to download the latest Python installer for Windows. The installer will be a
.exe
file.Run the Installer Click the download button to get the latest Python installer for macOS. The file will be a .pkg file.
Run the Installer Package Open the downloaded .pkg file to start the installation process. The installer will guide you through the installation steps.
Follow the Installation Wizard Proceed through the installation wizard by following the on-screen instructions. The installer will take care of placing Python in the appropriate directories and setting up your system.
Verify Installation To ensure Python is correctly installed, open the Terminal (you can find it in the Applications > Utilities folder) and type:
Linux
Most Linux distributions come with Python pre-installed, but it may not be the latest version. Here’s how to check if Python is installed and how to install or upgrade it if necessary.
Check Python Installation Open a terminal and type:
or
Navigate to the Downloads Section Once on the website, click on the “Downloads” tab in the navigation bar. The website should automatically detect that you are using Windows and suggest the latest version of Python compatible with your system.
Install Python Using Package Manager To install Python on Ubuntu (or other Debian-based distributions), use the following commands:
- Fedora:
- And for Arch Linux:
Verify Installation After installation, verify that Python is correctly installed by typing:
This command should return the version number of Python installed on your system. If Python is not installed, or if you need to install Python 3, proceed with the next steps.
For other distributions, use the equivalent package manager commands: