PyInstrument C Extension
raw JSON → 0.2.4 verified Fri May 01 auth: no python maintenance
A CPython extension that supports pyinstrument by providing a C-level hook for profiling. Version 0.2.4 is the latest release. The project is in maintenance mode; it is a dependency of pyinstrument and not typically used directly.
pip install pyinstrument-cext Common errors
error error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ↓
cause Missing Python headers or compilation dependencies.
fix
Install python3-dev or python3-devel package (e.g., 'sudo apt-get install python3-dev' on Debian/Ubuntu).
error ImportError: No module named pyinstrument_cext._cext ↓
cause The C extension failed to build or was not installed correctly.
fix
Reinstall with verbose output: 'pip install --no-cache-dir -v pyinstrument-cext'. Check for compiler errors.
Warnings
gotcha This package is a C extension and must be compiled during installation. If no pre-built wheel is available, a C compiler is required. ↓
fix Install with pip; if compilation fails, ensure you have a C compiler (e.g., 'build-essential' on Linux, Xcode on macOS, or Microsoft C++ Build Tools on Windows).
gotcha Do not import pyinstrument_cext directly in user code. It is an internal dependency of pyinstrument and its API may change without notice. ↓
fix Use pyinstrument for profiling. The extension is automatically loaded.
deprecated The project appears to be in maintenance mode with no recent updates. Future versions of pyinstrument may drop this dependency. ↓
fix Check pyinstrument release notes for any migration to alternative implementations.
Imports
- _cext
import pyinstrument_cext._cext
Quickstart
import pyinstrument_cext
# The extension is loaded automatically by pyinstrument, not used directly.