Installation

msgspec may be installed via pip or conda. Note that Python >= 3.8 is required. The basic install has no required dependencies.

pip

pip install msgspec

conda

conda install msgspec -c conda-forge

Optional Dependencies

Depending on your platform, the base install of msgspec may not support TOML or YAML without additional dependencies.

TOML

The TOML protocol requires:

  • Python < 3.11: tomli and tomli_w for reading and writing TOML.

  • Python >= 3.11: tomli_w for writing TOML. Reading TOML is done using the standard library’s tomllib and requires no additional dependencies.

You may either install these dependencies manually, or depend on the toml extra:

pip

pip install "msgspec[toml]"

conda

conda install msgspec-toml -c conda-forge

YAML

The YAML protocol requires PyYAML on all platforms. You may either install this dependency manually, or depend on the yaml extra:

pip

pip install "msgspec[yaml]"

conda

conda install msgspec-yaml -c conda-forge

Installing from GitHub

If you want wish to use a feature that hasn’t been released yet, you may install from the development branch on GitHub using pip:

pip install git+https://github.com/jcrist/msgspec.git