0% found this document useful (0 votes)
3 views18 pages

VSCode Python Setup Guide

Uploaded by

Anthony Umoh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views18 pages

VSCode Python Setup Guide

Uploaded by

Anthony Umoh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

VS CODE

COMPLETE PYTHON SETUP


GUIDE

Extensions · Libraries · Jupyter · Real-Time Results · Debugger · Settings

From a basic install to a professional Python environment — step by step

For: A developer in Port Harcourt, Nigeria · 2026

This guide takes you from a stock VS Code installation to a fully configured, professional-grade Python
and game development environment — with real-time results, full library access, intelligent autocomplete,
and a live debugger.

What This Guide Covers


<b>Step</b>
<b>What You'll Do</b> <b>Time Needed</b>

1 Install the 7 essential extensions 5 minutes

2 Connect VS Code to your Python 2 minutes

3 Install Python libraries via pip 5 minutes

4 Set up Jupyter for real-time results 3 minutes

5 Use the Python Interactive Window (REPL) 2 minutes


6 Configure the Debugger 5 minutes

7 Tweak your Settings for comfort 5 minutes

8 Your first Jupyter notebook session 10 minutes

Bonus Essential keyboard shortcuts cheatsheet Reference


1 Install the 7 Essential Extensions

Extensions are what transform VS Code from a basic text editor into a powerful Python IDE. A stock VS Code
knows almost nothing about Python — extensions give it intelligence, autocomplete, real-time feedback, and
access to your libraries. Do this first.

How to Open the Extensions Panel

Ctrl Shift X Opens the Extensions panel on the left sidebar

A search bar will appear at the top of the panel. Search for each extension by name below, click the blue Install
button, and wait for it to finish before moving to the next.

Python ESSENTIAL

by Microsoft

The absolute foundation. Gives VS Code the ability to understand, run, and debug Python code. Without this,
nothing else works. Install this first — it is non-negotiable.

Pylance ESSENTIAL

by Microsoft

The language intelligence engine. This is what gives you smart autocomplete that understands your entire
codebase, shows you what parameters a function expects, highlights errors before you run the code, and gives
you full visibility into every library you import.

Jupyter ESSENTIAL

by Microsoft

Transforms VS Code into an interactive notebook environment. With this installed, you can create .ipynb files
where you write code in cells and see results appear instantly inline — right below each block of code. This is
your real-time results solution.

Python Indent RECOMMENDED

by Kevin Rose

Automatically fixes Python indentation as you type. Python is very strict about indentation — wrong indentation
breaks your code. This extension handles it so you never have to think about it.

GitLens RECOMMENDED

by GitKraken

Connects VS Code directly to Git and GitHub. See who changed what, when, and why. Push and pull your code
to GitHub without leaving VS Code. Essential for version control and building your public portfolio.

Prettier USEFUL
by Prettier

Automatically formats your code to look clean and consistent every time you save. Proper formatting is a
professional habit — this builds it automatically.

Material Icon Theme USEFUL

by Philipp Kief

Gives every file type a distinct coloured icon in your file explorer. Makes navigating projects with many files
much easier visually. Small quality-of-life improvement that matters.

■ After installing ALL extensions, close VS Code completely and reopen it. This ensures all extensions load properly
and take full effect.
2 Connect VS Code to Your Python Installation

This is the most commonly missed step — and it's why many people find that libraries aren't recognised and
autocomplete doesn't work properly. VS Code needs to know exactly which Python installation to use on your
computer.

How to Select Your Python Interpreter


Follow these steps exactly:

1 Open the Command Press Ctrl + Shift + P. A search bar drops down from the top of VS
Palette Code. This is the most powerful feature in VS Code — it gives you
access to every command.

2 Search for the interpreter Type exactly: Python: Select Interpreter — then press Enter. A
command dropdown list will appear showing all Python installations detected on
your computer.

3 Select your Python Choose the option that shows your Python version number —
version something like Python 3.11.x or Python 3.12.x. If you see multiple
options, choose the one NOT labelled as 'system' — that's usually the
one pip installs libraries into.

4 Confirm it worked Look at the very bottom left of your VS Code window. You should now
see your Python version displayed there (e.g. 3.11.4). If you see it —
you're connected.

✓ Once your interpreter is selected, Pylance will immediately begin indexing your Python installation and all installed
libraries. Within 30-60 seconds, autocomplete will become fully intelligent across everything you've installed.

■ If Python is not installed on your computer yet, download it from [Link]. During installation on Windows, tick
the box that says 'Add Python to PATH' — this is critical and easy to miss.
3 Install Python Libraries via pip

pip is Python's package manager — it's how you install any library in the world with a single command. This is
not a VS Code limitation — ALL Python editors work this way. Once installed, a library is available in VS Code
immediately with full autocomplete.

How to Open the Terminal in VS Code

Ctrl ` Opens the integrated terminal (backtick key — top left of keyboard)

A terminal panel opens at the bottom of VS Code. This is a full command line — you type commands here and
press Enter to run them. It works exactly like opening a separate command prompt or terminal window.

Install Your Essential Libraries


Copy and paste each line below into your terminal and press Enter after each one. Wait for each to finish
downloading before running the next:

Jupyter & pip install jupyter Real-time interactive notebooks — your most
JupyterLab jupyterlab important install

2D game development — everything you need to


Pygame pip install pygame
make games with Python

Mathematical operations, arrays — used in almost


NumPy pip install numpy
every Python project

Charts and graphs — see visual output of your data


Matplotlib pip install matplotlib
and calculations

Make web requests — connect to APIs, download


Requests pip install requests
data from the internet

Image processing — open, edit, and create images


Pillow pip install Pillow
in Python

Work with data tables — essential for data analysis


Pandas pip install pandas
and AI projects

To install everything in one single command, paste this:

pip install jupyter jupyterlab pygame numpy matplotlib requests Pillow pandas

How to Verify a Library is Installed


In your terminal, type:

pip list

This shows every library currently installed. You should see all the ones you just installed in the list. You can
also verify by opening a Python file, typing import pygame, and checking that Pylance does NOT show a red
underline — if it's clean, it's installed.
4 Set Up Jupyter for Real-Time Results

This is the answer to your core problem — seeing results in real time as you code. Jupyter Notebooks let you
write code in individual cells and run each one separately, with output appearing immediately below that cell. No
running the entire script. No waiting. Results appear right next to your code as you work.

How to Create Your First Jupyter Notebook

1 Create a new file Go to File > New File, OR press Ctrl + N. A new empty file opens.

2 Save it as a .ipynb file Press Ctrl + S to save. Name your file something like
my_first_notebook.ipynb — the .ipynb extension is what tells VS Code
this is a Jupyter notebook, not a regular Python script.

3 Select your kernel VS Code will ask you to 'Select Kernel' at the top right of the file. Click it
and choose your Python interpreter (the same one from Step 2). The
kernel is the Python engine that runs your notebook cells.

4 You now have a You'll see a blank cell with a play button on the left. This is your first
notebook code cell. Everything from here works cell by cell.

How Cells Work — The Core Concept


Write code in a cell Click inside the cell. Type your Python code — anything from one line to
fifty lines.

Run the cell Press Shift + Enter. The cell runs and output appears immediately below
it. VS Code automatically creates a new cell below for your next block of
code.

Run just one cell You can run any cell at any time, in any order. Change one line, re-run
just that cell. Nothing else is affected.

Add a new cell Click the + Code button at the top of the notebook, or press B on your
keyboard when a cell is selected.

Delete a cell Click the cell, press Escape to exit edit mode, then press D twice (DD).
The cell is deleted.

Change to text/Markdown Press M when a cell is selected (not in edit mode). The cell becomes a
text cell for notes and explanations.

Your First Real-Time Session — Try This Now


Type each block below into a separate cell in your notebook and press Shift + Enter after each one:

Cell 1 — Basic output:


print("Hello from Port Harcourt!")

print("VS Code + Jupyter is working perfectly")


You will see the text appear immediately below the cell.

Cell 2 — Variables and calculations:


name = 'Renaissance Developer'

age = 20

year_mastery = age + 5

print(f'By {year_mastery}, {name} will have mastered 6 domains')

Cell 3 — A visual chart (matplotlib):


import [Link] as plt

skills = ['Python', 'Art', 'Violin', 'Mandarin', 'Finance', 'Presence']

progress = [60, 20, 30, 5, 40, 50]

[Link](skills, progress, color='steelblue')

[Link]('My Skills Progress')

[Link]('Level (%)')

[Link]()
A bar chart will render INSIDE the notebook, directly below this cell. This is the real-time visual output you were looking for.
5 Use the Python Interactive Window (REPL)

The REPL (Read-Evaluate-Print Loop) is a live Python interpreter that runs inside VS Code. You type one line of
code, press Enter, and see the result instantly. Perfect for quick tests, experiments, and checking how
something works without creating a full file.

Method 1 — Python REPL via Command Palette

Ctrl Shift P Open Command Palette

Then type: Python: Start REPL and press Enter.

A Python interactive window opens at the bottom. You'll see >>> — that means Python is ready and waiting for
your input. Type anything:

>>> 2 + 2

>>> name = 'Port Harcourt'

>>> print(f'Hello from {name}')

Hello from Port Harcourt

>>> import pygame

>>> pygame.__version__

'2.5.2'

Method 2 — Python in the Terminal


Ctrl ` Open terminal

Then simply type python and press Enter:

C:\Users\You> python

Python 3.11.4 (main)

Type 'help', 'copyright', 'credits' or 'license' for more information.

>>> _

You're now in a live Python session directly in the terminal. Type code, press Enter, see results. Type exit() to
leave.

When to Use Which


Jupyter Notebook (.ipynb) When you're learning, building step by step, want to keep your results
visible, or need charts and visual output. Best for most learning sessions.

Python REPL / Interactive When you want to test one quick thing — check a value, test a function,
verify a library works. In and out fast.
Regular .py Script When you're building a finished program, a game, or an app that needs to
run as a complete unit. Game dev with Pygame always uses .py files.
6 Configure and Use the Debugger

The debugger is one of the most powerful tools in VS Code — and most beginners never use it. Instead of
adding print() statements everywhere to find bugs, the debugger lets you pause your code at any line, inspect
every variable's value at that exact moment, and step through your code one line at a time watching exactly
what happens. This is how professional developers find and fix bugs.

How to Set a Breakpoint


A breakpoint is a marker that tells the debugger: 'pause here.' To set one, hover your mouse to the LEFT of any
line number in your code. A faint red dot will appear — click it and it turns solid red. That line is now a
breakpoint.

How to Run the Debugger

F5 Start debugging — runs your code until it hits a breakpoint

Your code runs normally until it reaches the red dot. Then it pauses. A yellow arrow appears on that line
showing exactly where execution stopped. The Debug panel on the left shows every variable and its current
value.

Debugger Controls — Once Paused

F10 Step Over — Run the current line and move to the next one. Stays at the same level.

F11 Step Into — If the current line calls a function, jump inside that function to see what happens.

Shift F11 Step Out — Finish the current function and return to where it was called from.

F5 Continue — Resume running normally until the next breakpoint (or end of program).

Shift F5 Stop — Stop debugging completely.

The Debug Console


While paused at a breakpoint, a Debug Console appears at the bottom. You can type any Python expression
here and see its value instantly — for example type my_variable and press Enter to see exactly what it contains
at that point in your code. Incredibly powerful for understanding what's going wrong.

✓ Pro tip: Once you learn the debugger, you will never use print() to find bugs again. The debugger gives you
complete visibility into your code at any moment. Make this a habit from the start.
7 Tweak Your Settings for Comfort & Efficiency

These settings make VS Code significantly more comfortable to use daily. Small changes that add up to a much
better experience over hundreds of hours of coding.

How to Open Settings

Ctrl , Opens the Settings panel

A search bar is at the top of Settings. Search for each setting name below and change it to the recommended
value:

Your code saves automatically every few seconds. You will


Auto Save afterDelay
never lose work by forgetting to press Ctrl+S.

Default is 12 — too small for long sessions. 14-15 is


Editor: Font Size 14 or 15
comfortable for most screens.

Long lines of code wrap to the next line instead of


Editor: Word Wrap on
disappearing off the right side of the screen.

Every time you save a file, your code is automatically


Editor: Format On Save checked (on)
reformatted to look clean and consistent.

Python standard is 4 spaces per indent. This ensures your


Editor: Tab Size 4
code matches the convention.

off The minimap on the right side shows a tiny preview of your
Editor: Minimap
(optional) whole file. Useful later — can be distracting early on.

Makes terminal text more readable. Search 'terminal font


Terminal: Font Size 13
size' in settings.

Gives matching brackets the same colour, making it easy to


Editor: Bracket Pair Colorization on
see where code blocks open and close.

Small quality of life — the cursor animation is gentler on


Editor: Cursor Blinking smooth
your eyes during long sessions.

Install a Better Theme (Optional but Highly Recommended)


The default VS Code theme is fine but many developers prefer darker, easier-on-the-eyes themes for long
sessions. In Extensions (Ctrl+Shift+X), search for any of these popular themes:

One Dark Pro The most popular VS Code theme. Dark, high contrast, easy on the eyes. Search:
'One Dark Pro'.

Dracula Official Dark purple theme — very popular with game developers and creative coders.
Search: 'Dracula Official'.
GitHub Dark Clean, minimal dark theme that matches GitHub's interface. Search: 'GitHub
Theme'.

Monokai Pro Rich colours, excellent syntax highlighting. Search: 'Monokai Pro'.

To apply a theme: after installing, press Ctrl+K then Ctrl+T — a theme picker dropdown appears. Click any theme to preview
it live.
8 Your First Complete Jupyter Session

Follow this as a walkthrough. Create a new .ipynb file, select your Python kernel, and run each cell below by
pressing Shift + Enter after typing each one. This confirms your entire setup is working correctly.

Cell 1 — Confirm Python is working


# This is a comment — Python ignores it

print("Setup complete. Python is running.")

print("Hello from VS Code + Jupyter!")

Cell 2 — Test variables and arithmetic


# Variables

my_name = 'Renaissance Developer'

my_age = 20

skills_count = 6

# Output

print(f'Name: {my_name}')

print(f'Age: {my_age}')

print(f'Skills being built: {skills_count}')

print(f'Skills per year: {skills_count / 2}')

Cell 3 — Test a library — NumPy


import numpy as np

# Create an array of numbers

scores = [Link]([70, 85, 90, 78, 95, 88])

print(f'Scores: {scores}')

print(f'Average: {[Link]():.1f}')

print(f'Highest: {[Link]()}')

print(f'Lowest: {[Link]()}')
Cell 4 — Test visual output — Matplotlib chart
import [Link] as plt

clusters = ['Technical', 'Visual', 'Sound', 'Mind', 'Presence', 'Language']

months_to_start = [0, 3, 6, 0, 2, 3]

colors_list = ['#1B6CA8','#6B3FA0','#E67E22','#2D6A4F','#E91E8C','#22A699']

[Link](figsize=(8, 4))

[Link](clusters, months_to_start, color=colors_list)

[Link]('My Renaissance Blueprint — Season Start Month')

[Link]('Month')

plt.tight_layout()

[Link]()

Cell 5 — Test Pygame import


import pygame

print(f'Pygame version: {pygame.__version__}')

print('Pygame is installed and ready for game development!')

✓ If all 5 cells run without red error messages, your VS Code setup is complete and working. You have Python,
Jupyter, NumPy, Matplotlib, and Pygame all confirmed and ready. You are now in a professional Python
development environment.
BONUS — Essential Keyboard Shortcuts — Master Reference

Learning these shortcuts will make you significantly faster. Don't try to memorise all at once — learn 2-3 per
week until they become automatic.

General VS Code

Ctrl Shift P Command Palette — access every VS Code command

Ctrl Shift X Open Extensions panel

Ctrl , Open Settings

Ctrl ` Open / close integrated terminal

Ctrl Shift ` Create a new terminal

Ctrl B Toggle sidebar (more screen space for code)

Ctrl \ Split editor into two panels side by side

Files & Navigation

Ctrl P Quick open — find any file by name instantly

Ctrl N New file

Ctrl S Save current file

Ctrl Shift S Save As

Ctrl W Close current file

Ctrl Tab Switch between open files

Ctrl G Go to a specific line number

Editing Code

Ctrl D Select the next matching word — multi-cursor editing

Ctrl H Find and replace text across the file

Ctrl / Comment or uncomment selected lines

Alt Up/Down Move a line up or down


Shift Alt Down Duplicate the current line below

Ctrl Z Undo last action

Ctrl Shift Z Redo

Tab Indent selected code (Python indentation)

Shift Tab Unindent selected code

Jupyter Notebooks

Shift Enter Run current cell and move to next

Ctrl Enter Run current cell and stay on it

Alt Enter Run current cell and insert new cell below

B Insert new cell BELOW (press Escape first)

A Insert new cell ABOVE (press Escape first)

DD Delete current cell (press Escape first, then D twice)

M Change cell to Markdown/text (press Escape first)

Y Change cell back to code (press Escape first)

Debugging
F5 Start debugging / continue to next breakpoint

F10 Step Over — run current line, move to next

F11 Step Into — enter a function call

Shift F11 Step Out — exit current function

Shift F5 Stop debugging

F9 Toggle breakpoint on current line


HELP — Common Problems & How to Fix Them

Problem: 'pip' is not recognised as a command

Solution: Python was not added to your system PATH during installation. Solution: Uninstall Python, redownload from
[Link], and during reinstallation tick 'Add Python to PATH' before clicking Install. Then restart VS Code.

Problem: Library installed but VS Code still shows red underline

Solution: VS Code is pointing to the wrong Python interpreter. Go to Ctrl+Shift+P > Python: Select Interpreter and
reselect your Python installation. Then reload the window with Ctrl+Shift+P > Developer: Reload Window.

Problem: Jupyter shows 'No kernel found' or 'Select Kernel' won't work

Solution: Make sure you ran: pip install jupyter jupyterlab in your terminal. Then restart VS Code completely. When
you open an .ipynb file, click 'Select Kernel' at the top right and choose your Python version.

Problem: Autocomplete is not working or very slow

Solution: Pylance needs a moment after VS Code opens to index your project. Wait 30-60 seconds after opening VS
Code. If it never starts working, check that Pylance is installed and your interpreter is selected correctly.

Problem: Code runs but I see no output anywhere

Solution: For .py files, output appears in the terminal at the bottom (press Ctrl+` to open it). For .ipynb files, output
appears directly below each cell after you press Shift+Enter. Make sure you're using the right file type for what you're
trying to do.

Problem: Pygame opens a window and then immediately crashes

Solution: Add [Link]() or a proper game loop to your Pygame code. Pygame requires an event loop to
keep the window open. This is normal beginner behaviour.

Problem: VS Code feels slow or laggy

Solution: Disable extensions you're not using (Ctrl+Shift+X, click each extension, Disable). Also close unused files
and terminals. VS Code gets heavier the more extensions run simultaneously.

VS Code Python Setup Guide · Compiled with Claude · April 2026 · Port Harcourt, Nigeria

You might also like