Python is one of the most popular programming languages in the world, powering everything from web applications and data science pipelines to automation scripts and artificial intelligence models. If you are using a Windows PC and want to start coding in Python, you first need to install it properly. This guide walks you through every step of the process, from downloading the installer to verifying your setup and creating your first virtual environment.
Why Install Python on Windows?
Unlike macOS and most Linux distributions, Windows does not ship with Python pre-installed. Microsoft does offer a stub in the Microsoft Store, but for serious development work you want a full installation from the official Python website. A proper installation gives you access to the Python interpreter, the pip package manager, IDLE (a simple code editor), and the ability to run Python from any terminal window on your system.
Step 1: Choose the Right Python Version
Head to python.org/downloads and you will see two types of releases: the latest stable release and older maintenance releases. As of 2026, Python 3.13 is the latest stable branch, while Python 3.12 remains widely supported by third-party libraries.
- Python 3.13.x – The newest release with performance improvements, better error messages, and experimental free-threaded mode. Choose this if you want the latest features.
- Python 3.12.x – A safe choice if you rely on packages that have not yet added Python 3.13 support.
For most beginners, downloading the latest stable release is the right move. You can always install additional versions later using a tool like pyenv-win.
Step 2: Download the Python Installer
On the Python downloads page, click the large yellow button labeled Download Python 3.x.x. This downloads the Windows installer (.exe file) for 64-bit systems, which is correct for virtually all modern Windows PCs.
If you need a 32-bit installer or a specific older version, scroll down the page and browse the full list of releases. For most users, the default 64-bit installer is perfect.
Step 3: Run the Installation Wizard
Locate the downloaded file (usually in your Downloads folder) and double-click it to launch the installer. Before clicking anything else, pay attention to the bottom of the first screen.
- Check "Add python.exe to PATH" – This is the single most important step. Enabling this option lets you run
pythonandpipfrom any Command Prompt or PowerShell window without specifying the full path. If you skip this, you will run into "python is not recognized" errors later. - Click "Install Now" for the default setup, which installs Python to your user directory and includes pip, IDLE, and the standard library. This is the recommended option for beginners.
If you want more control, choose "Customize installation" instead. This lets you pick optional features (documentation, tcl/tk support, the test suite) and choose a custom install location such as C:\Python313. Advanced users sometimes prefer this to keep things organized.
Optional Features Screen
If you chose the custom path, the next screen asks about optional features. Keep the following checked:
- pip – The package manager you will use to install libraries like requests, flask, and numpy.
- tcl/tk and IDLE – Useful if you plan to use IDLE or build GUI applications with tkinter.
- Python test suite – Can be unchecked to save space unless you plan to contribute to Python itself.
- py launcher – Installs the
pycommand, which helps manage multiple Python versions.
Advanced Options Screen
On the next screen, consider enabling:
- Install Python for all users – Installs to
C:\Program Files\Python313and requires admin privileges. - Add Python to environment variables – Make sure this is checked if it was not enabled on the first screen.
- Precompile standard library – Speeds up first-time imports. Worth keeping enabled.
Click Install and let the wizard do its work. The installation typically takes under a minute.
Step 4: Verify the Installation
Once the installer finishes, open a new Command Prompt or PowerShell window (you must open a new window so the updated PATH takes effect) and type:
python --version
You should see output like Python 3.13.2. If you get an error saying the command is not recognized, the PATH was not configured correctly. See the troubleshooting section below.
Also verify pip:
pip --version
This should print something like pip 24.3 from C:\Users\YourName\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip (python 3.13).
Step 5: Update pip
Even with a fresh installation, your pip version may not be the absolute latest. Update it immediately:
python -m pip install --upgrade pip
This ensures you have access to the latest features and bug fixes in the package manager.
Step 6: Install Your First Package
Test your setup by installing a popular package. For example:
pip install requests
Then open the Python interactive shell by typing python in your terminal and try:
import requests
response = requests.get("https://api.github.com")
print(response.status_code)
If you see 200, everything is working correctly.
Step 7: Set Up a Virtual Environment
Virtual environments are isolated Python environments that let you manage dependencies on a per-project basis. This prevents version conflicts between projects. Python ships with the venv module, so you do not need to install anything extra.
To create a virtual environment:
mkdir my_project
cd my_project
python -m venv venv
This creates a venv folder inside your project directory. To activate it on Windows:
venv\Scripts\activate
Your terminal prompt will change to show (venv) at the beginning, indicating the virtual environment is active. Any packages you install with pip while the environment is active will be installed only inside this environment.
To deactivate the virtual environment, simply type:
deactivate
Troubleshooting Common Errors
"python is not recognized as an internal or external command"
This means Python is not in your system PATH. You have two options:
- Re-run the installer – Run the installer again, select Modify, and make sure "Add Python to environment variables" is checked.
- Manually add to PATH – Open the Start Menu, search for "Environment Variables," click "Edit the system environment variables," then click "Environment Variables." Under "User variables," find
Path, click Edit, and add the path to your Python installation (e.g.,C:\Users\YourName\AppData\Local\Programs\Python\Python313and theScriptssubfolder).
"pip is not recognized"
This usually has the same root cause as the Python PATH issue. Make sure the Scripts directory is in your PATH. You can also invoke pip through Python directly:
python -m pip install package_name
Microsoft Store Opens Instead of Python
Windows 10 and 11 include app execution aliases that redirect python to the Microsoft Store. To fix this, open Settings > Apps > Advanced app settings > App execution aliases and turn off the entries for python.exe and python3.exe.
Permission Errors During Installation
If you see "Access denied" errors, try running the installer as Administrator by right-clicking the .exe file and choosing "Run as administrator." Alternatively, install for the current user only (the default "Install Now" option does this automatically).
Managing Multiple Python Versions with pyenv-win
As you work on more projects, you may need different Python versions. pyenv-win is a Windows port of the popular pyenv tool that lets you install and switch between multiple Python versions effortlessly.
Install pyenv-win using pip:
pip install pyenv-win --target %USERPROFILE%\.pyenv
After adding it to your PATH (follow the pyenv-win documentation for details), you can install and manage versions like this:
pyenv install 3.12.8
pyenv install 3.13.2
pyenv global 3.13.2
pyenv local 3.12.8
The global command sets the default version system-wide, while local sets the version for the current directory only.
Configuring Python in Your Code Editor
While the command line is where you run Python scripts, a good code editor makes writing code faster and less error-prone. If you use Visual Studio Code, install the official Python extension by Microsoft. It provides IntelliSense (code completion), linting, debugging, and virtual environment detection. Once installed, open the Command Palette (Ctrl+Shift+P), type "Python: Select Interpreter," and choose the Python version you just installed. VS Code will then use the correct Python for running and debugging your scripts.
You can also run Python files directly from VS Code by pressing the green play button in the top-right corner, or by pressing Ctrl+F5 to run without debugging. The output appears in the integrated terminal at the bottom of the editor.
Understanding pip and Package Management
pip is the standard package manager for Python, and you will use it constantly. Here are the commands you should know:
pip install package_name– Install a package from PyPI (the Python Package Index).pip install package_name==2.0.0– Install a specific version.pip uninstall package_name– Remove an installed package.pip list– Show all installed packages and their versions.pip freeze > requirements.txt– Save all installed packages to a file. This is essential for sharing your project with others; they can install the same packages by runningpip install -r requirements.txt.
Always install packages inside a virtual environment rather than globally. This keeps your system Python clean and avoids version conflicts between projects.
Next Steps After Installation
With Python installed and working, here are some logical next steps to continue your journey:
- Learn the basics – Start with variables, data types, loops, and functions. The official Python tutorial at
docs.python.org/3/tutorialis an excellent free resource. - Choose a code editor – While IDLE works for simple scripts, you will want something more powerful. Visual Studio Code with the Python extension is the most popular choice in 2026.
- Explore popular libraries – Install libraries like
flaskfor web development,pandasfor data analysis, orpygamefor game development. - Practice with projects – Build a calculator, a to-do list app, or a web scraper to solidify your skills.
Conclusion
Installing Python on Windows is straightforward as long as you remember the critical step: checking "Add python.exe to PATH" during installation. With Python and pip set up, you are ready to install packages, create virtual environments, and start building projects. If you run into any issues, the troubleshooting section above covers the most common problems and their solutions. Happy coding!