Set Up Your Toolkit: Python, the Terminal & an Editor
Introduction
In short: A working data-science setup is three parts: a Python interpreter to run code, a terminal to type commands, and an editor to write and save scripts.
Before you can analyse a single row of data, you need a working environment: a Python interpreter to run your code, a terminal to give your computer typed commands, and a code editor to write and save your scripts. This lesson assumes you have never written a line of code. We will install everything from scratch, learn the handful of terminal commands you will use every day, and run your very first Python program.
Do not rush this. A clean, well-understood setup saves you hours of confusion later. Every professional data scientist works inside exactly this toolkit.
Step 1: Install Python
In short: Install Python 3 from python.org, tick Add to PATH on Windows, and verify the install with python --version before anything else.
Python is the language we will use for the entire course. Go to the official site, python.org/downloads, and download the latest stable Python 3 release for your operating system.
- Windows: Run the installer. Critically, tick the box "Add python.exe to PATH" on the first screen before clicking Install. This lets the terminal find Python.
- macOS: Run the
.pkginstaller, or install via Homebrew withbrew install python.
To confirm it worked, open a terminal (see Step 2) and type:
python --version
You should see something like Python 3.12.4. On some macOS/Linux systems the command is python3:
python3 --version
If you see a version number, Python is installed. If you see "command not found", Python is not on your PATH — reinstall and make sure the PATH box is ticked (Windows) or restart your terminal.
Step 2: Meet the Terminal
In short: The terminal runs typed commands; pwd, ls or dir, cd, and mkdir cover almost all the folder navigation you will ever need.
The terminal (also called the command line, shell, or console) is a text window where you type commands instead of clicking buttons. Data scientists live here.
- Windows: Use PowerShell or Windows Terminal (search for it in the Start menu).
- macOS: Use Terminal (in Applications → Utilities).
You will use these four commands constantly. They are the same idea on every system:
pwd # "print working directory" — where am I right now?
ls # "list" — show files & folders here (use `dir` in Windows PowerShell)
cd projects # "change directory" — move into the folder called projects
cd .. # move UP one folder (back to the parent)
mkdir myapp # "make directory" — create a new folder called myapp
A quick worked session — create a project folder, move into it, and confirm:
mkdir data-science-course
cd data-science-course
pwd
# /Users/you/data-science-course (or C:\Users\you\data-science-course)
That is 90% of the navigation you will ever need. Folders are just nested boxes; cd walks between them.
Step 3: Install a Code Editor
In short: Use VS Code with the official Microsoft Python extension for syntax colouring, code completion, and one-click running of scripts.
You could write Python in Notepad, but a real editor gives you syntax colouring, error highlighting, and an integrated terminal. We recommend Visual Studio Code (VS Code) — it is free, hugely popular, and works on every OS. Download it from code.visualstudio.com.
After installing, open VS Code and install the official Python extension (click the Extensions icon in the sidebar, search "Python" by Microsoft, click Install). This adds code completion and lets you run scripts with one click.
Step 4: Write and Run Your First Script
In short: Save Python code in a file ending in .py and run it with python filename.py from the folder that contains it.
In your data-science-course folder, create a file called hello.py. In VS Code: File → New File, then save it as hello.py. Type this in:
# hello.py — my first Python program
name = "data scientist"
print("Hello, future " + name + "!")
for i in range(1, 4):
print(f"Run number {i}")
Save the file. Now run it from the terminal (make sure you are cd'd into the folder):
python hello.py
Expected output:
Hello, future data scientist!
Run number 1
Run number 2
Run number 3
Congratulations — you just wrote and executed a program. The # line is a comment (ignored by Python). print() shows text. The for loop repeats. We will cover all of this properly in the next lesson.
Step 5: Virtual Environments (the professional habit)
In short: Create a per-project sandbox with python -m venv .venv, activate it, and install libraries with pip so projects never clash.
Different projects need different package versions. A virtual environment is an isolated, per-project Python sandbox so one project's libraries never break another's. This is standard practice — create one for every project.
# Create a virtual environment named ".venv" in the current folder
python -m venv .venv
# Activate it
source .venv/bin/activate # macOS / Linux
.venv\Scripts\activate # Windows PowerShell
# Your prompt now shows (.venv). Install a package with pip:
pip install numpy
# List what's installed
pip list
# When you're done working
deactivate
pip is Python's package installer — it downloads libraries (like NumPy and pandas) from the Python Package Index. Installing inside an activated .venv keeps that package local to this project only.
Key Takeaways
- Python is the language; install it from python.org and verify with
python --version. On Windows, always tick "Add to PATH". - The terminal is where you run code. The four commands
pwd,ls/dir,cd, andmkdircover almost all navigation. - VS Code with the Python extension is a free, professional editor — write scripts there and save them with a
.pyextension. - Run any script with
python filename.pyfrom the folder that contains it. - A virtual environment (
python -m venv .venv, then activate) isolates each project's packages. Create one per project and install libraries withpipinside it. - This toolkit — Python, terminal, editor, venv, pip — is the exact setup every data scientist uses daily. Get comfortable here and everything else gets easier.
