Contents
- 1 How to install Python on Windows – step by step
- 1.1 Select Version of Python to Install
- 1.2 Download Python Executable Installer
- 1.3 Run Executable Installer
- 1.4 Verify Python Installation
- 1.5 Verify Pip Installation
- 1.6 Install virtualenv (Optional)
- 1.7 How to Install AnTuTu on Android
- 1.8 Top 5 WooCommerce Hosting Solutions for 2024
- 1.9 5 Best and Affordable CPUs for Your PC in 2024
- 1.10 25 Useful Python Commands for Excel
- 1.11 How to Exploit Windows 7 Vulnerabilities [Code Inside]
- 1.12 Ditching Windows 7 in 2024: A Comprehensive Guide
How to install Python on Windows – step by step
Choosing the right Python version is key for both legacy projects and modern development. With Python 2 reaching its end of life, Python 3 is the recommended choice for new projects. This guide covers selecting, downloading, and installing Python.
Select Version of Python to Install
Python 3 is generally recommended for new projects. Among the Python 3 series, picking a stable release, like Python 3.9, offers a good balance between new features and stability.
On the official Python website, go to the Downloads section for Windows to see available Python versions. Choose either the 32-bit or 64-bit installer depending on your system specifications.
After downloading, run the executable file to start installation. Check the boxes to add Python to the PATH variable and use admin privileges. Click “Install Now” for the recommended installation, or “Customize installation” to adjust settings.
During customization, consider including the PIP package manager and IDLE. You can also choose to associate Python files with the Python launcher, preload the standard library, and add Python to environment variables.
After installation, verify by opening a command prompt and typing:
python --version
pip --version
These commands should display the installed Python and PIP versions.
To create isolated environments for projects, consider using the virtualenv
package:
pip install virtualenv
This allows you to keep dependencies contained for each project.
Download Python Executable Installer
- On the official Python website, locate the “Downloads for Windows” section.
- Choose a stable release like Python 3.9.1.
- Select the Windows x86-64 executable installer for 64-bit systems, or the Windows x86 executable installer for 32-bit systems.
- Click the appropriate download link. The file size is less than 30MB.
After downloading, locate the file and double-click to launch the setup.
In the setup wizard, tick “Add Python to PATH” to enable command-line access without the full path. The “Install launcher for all users” option allows system-wide access.
Click “Install Now” for default settings, or “Customize installation” to adjust the installation directory and additional features.
During customization, you can choose to install optional packages like documentation and debugging tools. In Advanced Options, you can associate Python with supported file types and add Python to environment variables.
After adjusting preferences, click “Install” to begin the installation.
Run Executable Installer
- Double-click the downloaded executable file to start the setup.
- In the initial configuration screen, select “Install launcher for all users” and “Add Python to PATH” for optimal setup.
- Click “Install Now” for default settings, or “Customize installation” for more control.
- In the customization screen, you can change the installation directory and choose which features to include.
- The Advanced Options dialog allows for more detailed settings, such as installing Python for all users or setting Python as the default application for .py files.
- After reviewing settings, click “Install” to start the installation process.
- Upon completion, you’ll have the option to disable the path length limit.
Verify the installation by opening a command prompt and running:
python --version
pip --version
These commands should display the installed Python and PIP versions.
Verify Python Installation
Open the command prompt and type:
python --version
This should return the installed Python version.
To test IDLE, open it from the Start menu. In the IDLE window, type:
print("Hello, World!")
This should output:
Hello, World!
These steps confirm that Python and IDLE are functioning correctly on your system.
Verify Pip Installation
Open a command prompt and type:
pip --version
This should display the PIP version, path, and associated Python version.
If PIP isn’t recognized, you can install it manually:
- Download the
get-pip.py
script from https://bootstrap.pypa.io/get-pip.py - Save it in a directory of your choice
- Open the command prompt, navigate to the directory, and run:
python get-pip.py
- After installation, verify again with:
pip --version
With PIP set up, you can now manage Python packages for your projects.
Install virtualenv (Optional)
Consider installing virtualenv
to enhance your Python development setup. This tool creates isolated local environments for different Python projects, preventing package conflicts and ensuring project-specific dependencies.
To install virtualenv
, open the command prompt and run:
pip install virtualenv
To create a new virtual environment for your project:
mkdir my_project
cd my_project
virtualenv venv
Activate the virtual environment:
- On Windows:
.venvScriptsactivate
- On MacOS/Linux:
source venv/bin/activate
Your command prompt will now show the environment name, indicating you’re working within the isolated setup. Install packages using PIP, and they’ll be contained within this environment:
pip install requests
To deactivate the virtual environment, type:
deactivate
Using virtualenv
improves project manageability by keeping dependencies isolated, ensuring updates in one environment don’t affect another.

By following these steps, you’ll have a Python setup ready for various programming tasks, essential for a smooth workflow in scripting, web development, data analysis, or machine learning.