Skip to content

Installation

2.0 is in pre-release

These docs describe TypeSpark 2.0. Add --pre to the commands below to install it, e.g. pip install --pre "typespark[pyspark]". Without --pre, pip installs 1.x.

TypeSpark declares PySpark as an optional dependency so it never pins the Spark version in your cluster/runtime. Install the extra to pull it in locally:

pip install "typespark[pyspark]"

If your environment already provides PySpark, as managed Spark platforms do, just:

pip install typespark

Requires Python 3.12+. Ships a py.typed marker, so type information is available to downstream consumers with no extra configuration (PEP 561).

Static checking is supported with pyright (and Pylance in VS Code) and mypy. See Static checking for setup.

Supported versions

PySpark Python 3.12 Python 3.13 Python 3.14
3.5 ✓ ✓ —
4.0 ✓ ✓ ✓
4.1 ✓ ✓ ✓
4.2 ✓ ✓ ✓
4.3 ✓ ✓ ✓

✓ supported and tested in CI · — not supported

  • PySpark 3.5 doesn't run on Python 3.14: use PySpark 4.0 or later there.
  • PySpark 3.5 needs setuptools installed for PySpark's pandas support (it imports distutils, which Python 3.12 removed).
  • A few functions need Spark 4: see Functions.
  • How versions are added and dropped: see Version policy.