Now that you understand what Python is and why it's a valuable tool for developers, the next step is to set it up on your computer. This section will guide you through installing Python on a Windows operating system. The process is quite straightforward, thanks to the user-friendly installer provided by the Python Software Foundation.
First, you need to obtain the official Python installer for Windows.
.exe
file. The website usually detects whether you have a 32-bit or 64-bit version of Windows and offers the appropriate installer. If you have a choice, select the 64-bit installer for modern systems unless you have a specific reason to use the 32-bit version.Once the download is complete, locate the .exe
file (usually in your Downloads folder) and double-click it to start the installation.
Launch the Installer: You might be prompted by Windows User Account Control to allow the app to make changes to your device. Click "Yes".
Configure Installation Options: The first screen of the installer presents some important choices.
Install Now
: This is the recommended option for beginners. It installs Python with default settings in a standard user directory and includes IDLE (a simple development environment), pip (the package installer), and documentation.
Customize installation
: This allows you to choose specific features, change the installation location, and configure other advanced options. For this course, the default Install Now
is sufficient.
What is the PATH? The PATH is an environment variable on Windows (and other operating systems). It contains a list of directories. When you type a command like
python
into the Command Prompt, Windows searches through the directories listed in the PATH variable to find an executable file namedpython.exe
. Checking "Add Python to PATH" during installation automatically adds Python's installation directory to this list, making Python easily accessible.
Proceed with Installation: Click Install Now
(after ensuring the "Add Python to PATH" box is checked). The installer will show a progress bar as it copies files and sets up Python.
Setup Successful: Once the installation is complete, you should see a "Setup was successful" message. You might also see an option to "Disable path length limit". Clicking this can help avoid potential issues with long file paths in certain development scenarios. It's generally safe and recommended to disable the limit if offered.
Close the Installer: You can now close the installer window.
To ensure Python was installed correctly and is accessible, you need to verify it using the Command Prompt or PowerShell.
cmd
, and press Enter to open the Command Prompt.powershell
, and press Enter to open PowerShell. Both will work for verification.python --version
You might also try:
py --version
If the installation was successful and Python was added to PATH, you should see output similar to this (the version number may differ):
Python 3.11.4
pip --version
You should see output indicating the pip version and its location, for example:
pip 23.1.2 from C:\Users\YourUsername\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
Troubleshooting: If you type python --version
and receive an error message like "'python' is not recognized as an internal or external command...", the most common reason is that Python was not added to the PATH environment variable during installation. The simplest solution is often to uninstall Python (via Windows Settings > Apps) and reinstall it, making sure to check the "Add Python to PATH" box this time.
Congratulations! You have successfully installed Python on your Windows system and verified that it's ready to use. You're now prepared to start interacting with the Python interpreter or writing your first script, which we'll cover next.
© 2025 ApX Machine Learning