Python Setup (2026): Install Python, VS Code, pip and Virtual Environments

Part 1 of the Python for Everyone track. Last updated: September 2026.

Before writing a single line of Python, you need three things: the Python interpreter, a code editor, and a way to install third-party packages. This guide gets all three set up on Windows, macOS, and Linux in about 15 minutes.

Step 1: Install Python

Download the latest Python 3.x from python.org/downloads. On Windows, tick "Add python.exe to PATH" during installation — forgetting this is the #1 beginner setup mistake.

Verify the install:

python --version
# or on macOS/Linux:
python3 --version

You should see something like Python 3.12.x or newer. Never use Python 2 — it reached end of life in 2020.

Step 2: Install VS Code

Download Visual Studio Code from code.visualstudio.com, then install the Python extension by Microsoft (search "Python" in the Extensions panel). It gives you IntelliSense, debugging, and one-click running of scripts.

Step 3: Run your first program

Create a file named hello.py:

print("Hello, Python!")

Run it from the terminal:

python hello.py
# Output: Hello, Python!

Step 4: pip — installing packages

pip is Python's package manager. It installs libraries from PyPI (the Python Package Index):

pip install requests        # install a package
pip list                    # show installed packages
pip show requests           # details of one package
pip freeze > requirements.txt   # save exact versions for sharing
pip install -r requirements.txt # reinstall from that file

Step 5: Virtual environments (do this from day one)

A virtual environment is an isolated Python setup per project, so package versions never clash between projects:

# Create it (once per project)
python -m venv venv

# Activate it
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate

# Your prompt now shows (venv) — install freely:
pip install requests

# Done for the day? Deactivate:
deactivate

Rule of thumb: one project = one virtual environment, and never install project packages globally.

Key takeaways

  • Install Python 3.x from python.org and tick "Add to PATH" on Windows.
  • VS Code + the Microsoft Python extension is the standard beginner editor.
  • pip installs packages; requirements.txt shares them.
  • Use python -m venv for every project — no exceptions.

Next in this series: Python Variables, Data Types and Operators with Examples.

Comments

Popular posts from this blog

JSP Servlet Interview Questions For Freshers Series 1

Java Banking Finance Services and Insurance (BFSI) domain interview questions

Java program to check even or odd number