# Prerequisites ```shell pip install pyspark jupyter findspark ``` # Shell setup If you want the `pyspark` command to open Notebooks instead of a shell, set the following: ```shell export PYSPARK_DRIVER_PYTHON=jupyter export PYSPARK_DRIVER_PYTHON_OPTS='notebook' ``` Ref. https://medium.com/sicara/get-started-pyspark-jupyter-guide-tutorial-ae2fe84f594f # VS Code setup Use `CMD-SHIFT-P` and search for "create notebook"; run it. In the notebook, create a Spark session with this: ```python import findspark findspark.init() import pyspark sc = pyspark.SparkContext(appName="MyApp") from pyspark.sql import SparkSession spark = SparkSession.builder.getOrCreate() ``` Ref. https://analyticshut.com/integrate-spark-with-jupyter-notebook-and-visual-studio-code/