PySpark Development Made Simple
Using VS Code, Jupyter Notebooks, and Docker

A few weeks back, I was searching for that holy grail of a tutorial describing how to use VS Code with Jupyter Notebooks and PySpark… on a Mac. And surprisingly, I couldn’t find any. Well, none that passed my “explain-it-like-I’m-five” litmus test.
This article is the result of an agonising Saturday afternoon.
The Path of Least Resistance: REPLs to the Rescue
These days I have very little, if any, free time for playing around with new tech. When I do, I want it to be as painless as possible. And most importantly, I want it to be fun — otherwise, why bother?
Moreover, nothing is worse than wasting hours of your free time configuring a development environment. It’s just painful.
VS Code with Jupyter Notebooks
I’m a big fan of REPLs for rapid development — for example, evaluating a new framework, analysing data, data fixes, etc.
In these situations, I don’t want to configure a new project and get bogged down with trivial set-up complexities. I simply need a scratchpad to thrash out some code.
Jupyter Notebooks are a REPL-based system designed to analyse, visualise, and collaborate on data. They are also great as a scratchpad.
What is a REPL?
A read–eval–print loop (REPL), also termed an interactive top level or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise. Wikipedia
Visual Studio code has native support for Notebooks, including Jupyter.
Setup
Prerequisites
- Install Docker If you’re using a Mac and cannot install Docker Desktop due to licensing restrictions, check out Colima.
- Install VS Code
VS Code Development Container
- Create a new directory for your project.
- Create a Docker file within the root of the project directory using the code below. At the time of writing this, the current PySpark version is 3.3.0. I would check here to ensure you’re using the latest version.






