CoderJony
HomeBlogAboutContact
CoderJony

Full-stack engineering, cloud architecture, and scalable systems

ankushjain358@gmail.com
Β© 2026 CoderJony. All rights reserved.
CoderJony
HomeBlogAboutContact
Back to Articles

Python Setup on Windows: A Practical Guide for Developers

A
Ankush Jain
March 10, 2026
Python
Python Setup on Windows: A Practical Guide for Developers

Setting up Python on your local machine is simple, but a few best practices can make development much smoother and easier to maintain.

This guide walks through:

  • Installing Python

  • Setting up virtual environments

  • Configuring VS Code for development

  • Managing dependencies with pip

  • Running and deploying Python applications

If you're coming from ecosystems like .NET or Node.js, this guide will also clarify how Python handles environments and dependency management.


Installing Python

Download Python from the official website:

πŸ‘‰ https://www.python.org/downloads/

Steps:

  1. Download the latest Python 3.x installer for Windows.

  2. Run the installer.

  3. Important: Check the option Add Python to PATH.

  4. Click Install Now.

Adding Python to PATH allows you to run python commands directly from the terminal.


Verifying Installation

Open Command Prompt or PowerShell and run:

python --version

Example output:

Python 3.12.2

Check pip (Python’s package manager):

pip --version

Example output:

pip 23.2 from C:\Users\<username>\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip

If both commands work, Python has been installed successfully.


Your First Python Project

Python development usually starts in one of two ways:

  1. Creating a new project

  2. Working with an existing repository

Let's start with a new project.


Creating a New Python App

Step 1 β€” Create a project folder

Example:

my_python_app

Step 2 β€” Create a virtual environment

python -m venv .venv

This creates an isolated Python environment inside:

.venv/

Step 3 β€” Activate the virtual environment

Windows:

.venv\Scripts\activate

You should now see:

(.venv)

in the terminal.

Verify activation:

echo %VIRTUAL_ENV%

Step 4 β€” Install dependencies

Example:

pip install flask requests

Important:

When pip install runs inside an activated virtual environment, packages are installed locally inside .venv, not globally.


Step 5 β€” Freeze dependencies

pip freeze > requirements.txt

Example:

flask==3.0.1
requests==2.31.0

This file ensures other developers or servers can install the exact same dependency versions.


Working With an Existing Python Project

Most real-world work starts by cloning a repository.

1. Clone the repository

git clone repo-url

2. Create virtual environment

python -m venv .venv

3. Activate environment

.venv\Scripts\activate

4. Install dependencies

pip install -r requirements.txt
pip install -r requirements-dev.txt

Example:

(.venv) C:\Users\ankushzn\Desktop\app_backend>pip install -r requirements-dev.txt

5. Run the application

Example:

streamlit run helloworld.py

Virtual Environments

A virtual environment isolates dependencies for a project.

This prevents conflicts between different projects.

Example:

Project A might require:

Django 3

Project B might require:

Django 5

Virtual environments allow both versions to coexist safely.


Important VS Code Extensions

Install Visual Studio Code along with the following extensions.

Python (Microsoft)

Provides core Python support:

  • Interpreter selection

  • Debugging

  • IntelliSense


Pylance

High-performance language server providing:

  • Autocomplete

  • Type checking

  • Import suggestions

  • Code navigation


Black

Opinionated code formatter.

Benefits:

  • Consistent formatting

  • Eliminates style debates

  • Automatically formats code on save


isort

Automatically sorts imports.

Before:

import sys
import requests
import os

After:

import os
import sys

import requests

Flake8

Linting tool that detects:

  • unused imports

  • style issues

  • potential mistakes


Python vs Pip

Tool

Purpose

Python

Interpreter that runs .py files

pip

Package manager used to install libraries

Example:

Run Python file:

python app.py

Install dependency:

pip install requests

Why Sometimes You See python3 or pip3

On systems with both Python 2 and Python 3 installed, commands may differ.

Command

Meaning

python

Default Python interpreter

python3

Explicitly Python 3

pip

Package manager for default Python

pip3

Package manager for Python 3

Most modern Windows systems map python directly to Python 3.


Python Interpreters

A Python interpreter is simply the python.exe executable that runs Python programs.

You can have multiple interpreters installed:

C:\Python310\python.exe
C:\Python312\python.exe
project\.venv\Scripts\python.exe

Each interpreter has its own package environment.

Changing the interpreter simply means telling your IDE or terminal:

Use a different python.exe to run this project.

In VS Code:

Ctrl + Shift + P β†’ Python: Select Interpreter

Checking Which Python Is Being Used

You can verify the active interpreter using:

where python

Example output:

C:\Users\<username>\project\.venv\Scripts\python.exe
C:\Users\<username>\AppData\Local\Programs\Python\Python312\python.exe

The first entry is the one currently used.

Similarly:

where pip

Why Many Engineers Prefer python -m pip

Instead of:

pip install requests

many engineers prefer:

python -m pip install requests

This guarantees the package installs into the same Python environment as the interpreter you invoked.

For example:

python  β†’ Python 3.12
pip     β†’ Python 3.10

Using python -m pip avoids such mismatches.


Where Python Gets Installed

Typical Windows installation location:

C:\Users\<username>\AppData\Local\Programs\Python\Python312\

Important directories:

Directory

Purpose

python.exe

Python interpreter

Scripts/

CLI tools like pip

Lib/site-packages

Installed packages


Where pip Installs Packages

Global installation

C:\Users\<username>\AppData\Local\Programs\Python\Python312\Lib\site-packages

Virtual environment installation

project\.venv\Lib\site-packages

How Virtual Environments Work

Running:

python -m venv .venv

creates:

.venv
 β”œβ”€β”€ Include
 β”œβ”€β”€ Lib
 β”‚    └── site-packages
 β”œβ”€β”€ Scripts
 β”‚    β”œβ”€β”€ python.exe
 β”‚    β”œβ”€β”€ pip.exe
 β”‚    └── activate
 └── pyvenv.cfg

When the environment is activated:

.venv\Scripts\

is added to the beginning of the system PATH, so python and pip resolve to the local environment versions.


Packaging for Deployment

Unlike .NET or Node.js, Python applications are usually deployed by recreating environments.

Typical deployment steps:

  1. Maintain dependency file

requirements.txt
  1. Create environment on server

python -m venv .venv
  1. Install dependencies

pip install -r requirements.txt
  1. Run application

python app.py

or

gunicorn app:app

Summary

A solid Python setup usually includes:

  • Installing Python from the official website

  • Verifying installation with python --version

  • Using virtual environments (venv)

  • Managing dependencies with requirements.txt

  • Installing helpful VS Code extensions

  • Using python -m pip to avoid environment issues

Following these practices keeps Python projects clean, reproducible, and easy to maintain.

A

About Ankush Jain

Hi, I am Ankush Jain - a software engineer with 13+ years of experience building scalable software systems across backend, frontend, and cloud platforms.

WebsiteTwitterGitHubLinkedIn
CoderJony

Full-stack engineering, cloud architecture, and scalable systems

ankushjain358@gmail.com
Β© 2026 CoderJony. All rights reserved.