PYTHON-CONFIG(1)
π PYTHON-CONFIG(1) π
okay bestie, welcome to the General Commands Manual page for python-config β yes that's the manual name right there, we're not doing a boring header line, we're doing β¨vibesβ¨.
πΈ NAME πΈ
python-config β spits out the build options you need for python C/C++ extensions, or for embedding, no cap π
π SYNOPSIS π
python-config [ --prefix ] [ --exec-prefix ] [ --includes ] [ --libs ] [
--cflags ] [ --ldflags ] [ --extension-suffix ] [ --abiflags ] [ --help
]
π¦ DESCRIPTION π¦
so like. python-config is the girl who helps you compile and link your programs π₯ β the ones that embed the Python interpreter, or the extension modules that get loaded dynamically (like, at run time, bestie) into the interpreter. she's got you π«Ά
β¨ OPTIONS β¨
--abiflagsβ prints the ABI flags, as specified by PEP 3149. (the original totally says "the the", we're not judging, we're just printing the ABI flags π)--cflagsβ prints the C compiler flags.--ldflagsβ prints the flags you should be passing to the linker.--includesβ basically--cflags's little sister, except it only gives you the-Ioptions (that's the path to the python header files π).--libsβ same energy as--ldflags, except it only gives you the-loptions (the libraries being used).--prefixβ prints the prefix (the base directory) that python lives under π .--exec-prefixβ prints the prefix used for executable program directories (thinkbin,sbin, etc.).--extension-suffixβ prints the extension suffix used for binary extensions.--helpβ prints the usage message. classic.
π EXAMPLES π
π building a single-file c program
say you wanna build the single-file c program prog against the python library β use:
gcc $(python-config --cflags --ldflags) progr.cpp -o progr.cpp
π§ same thing but in a makefile
CFLAGS+=$(shell python-config --cflags)
LDFLAGS+=$(shell python-config --ldflags)
all: progr
π building a dynamically loadable python module
gcc $(python-config --cflags --ldflags) -shared -fPIC progr.cpp
-o progr.so
π SEE ALSO π
python(1)http://docs.python.org/extending/extending.html/usr/share/doc/python/faq/extending.html
π AUTHORS π
this manual page was written by Johann Felix Soden <johfel@gmx.de> for the Debian project (and yes, it may be used by others, slay π«Ά).
fr fr that's the whole page, nothing skipped, every flag accounted for π
so yeah, that's the General Commands Manual version β November 27, 2011, babes, and it's giving iconic. periodt. β¨ππ¦
π¦ where this page comes from
- ubuntu stonking: libpython3.14-dev 3.14.8-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms