Installation¶
pip install expatjson
Python 3.9 or later. Prebuilt native wheels are available for:
| OS | CPU | Python |
|---|---|---|
| Windows | x86-64, ARM64 (3.11+) | 3.9 – 3.14 |
| Linux (glibc, musl) | x86-64, ARM64 | 3.9 – 3.14 |
| macOS | Intel, Apple silicon | 3.9 – 3.14 |
python -c "import expatjson; print(expatjson.backend())" # native or python
It prints python (build the C++ extension)
Other platforms use the pure Python parser. To use the C++ extension, install a C++ compiler and reinstall.
| OS | Compiler |
|---|---|
| Windows | Build Tools for Visual Studio, "Desktop development with C++" |
| Debian / Ubuntu | sudo apt install build-essential python3-dev |
| Fedora / RHEL | sudo dnf install gcc-c++ python3-devel |
| macOS | xcode-select --install |
EXPATJSON_REQUIRE_NATIVE=1 pip install --no-cache-dir --force-reinstall --no-binary expatjson expatjson
In PowerShell run $env:EXPATJSON_REQUIRE_NATIVE="1" first. With it, the installation fails with the
compiler's message instead of silently falling back.
Install without PyPI
pip install git+https://github.com/solitary-coffee/expatjson.git # latest source
pip install ./expatjson-<version>-<tags>.whl # a downloaded wheel