Install FailureWindowsPython 3.10 · 3.11 · 3.12

fatal error: gmp.h: No such file or directory

pip install fastecdsa
Collecting fastecdsa
Downloading fastecdsa-2.3.2.tar.gz (89 kB)
Installing build dependencies ... done
Running setup.py install for fastecdsa ... error
error: subprocess-exited-with-error
× python setup.py install did not run successfully.
...
mathlib.c:7:10: fatal error: gmp.h: No such file or directory
7 | #include <gmp.h>
| ^~~~~~
compilation terminated.

fastecdsa wraps GMP — the GNU Multiple Precision Arithmetic Library — a native C library that must be present at build time. On Windows, GMP is not installed by default and there is no pre-built wheel for Python 3.10+ on win_amd64, so pip always tries to compile from source and fails immediately when it cannot find gmp.h.

Windows · Python 3.12
pip · failsconda-forge · ok
Windows · Python 3.11
pip · failsconda-forge · ok
Windows · Python 3.10
pip · failsconda-forge · 2.3.0 only
Linux · Python 3.10–3.12
pip · okconda-forge · ok
macOS (Apple Silicon)
pip · needs brew gmpconda-forge · ok

1Use conda-forgeEasiest

If you're using Anaconda or Miniconda, conda-forge ships a pre-compiled build that includes GMP. No compiler or system dependencies required.

# If you're in a conda environment
conda install -c conda-forge fastecdsa
2Install GMP via MSYS2, then pip installMedium

MSYS2 provides GMP for Windows. Install it, then point pip to the headers and libraries before building. Requires a working C compiler (MSVC or MinGW-w64).

# In MSYS2 MinGW64 shell
pacman -S mingw-w64-x86_64-gmp mingw-w64-x86_64-gcc

# Then in your Python env
set INCLUDE=C:\msys64\mingw64\include
set LIB=C:\msys64\mingw64\lib
pip install fastecdsa
3Use the cryptography package insteadAlternative

If you don't specifically need fastecdsa's API, the cryptography package ships pre-built wheels for all platforms and covers the same use cases.

pip install cryptography

# ECDSA signing with cryptography
from cryptography.hazmat.primitives.asymmetric import ec
key = ec.generate_private_key(ec.SECP256K1())

fastecdsa · Compatibility Matrix
See install results across all Python versions and operating systems
→
Observed in 222 searches · Last verified Aug 2026
fatal error: gmp.h: No such file or directory — fastecdsa