{
    "mode": "man",
    "parameter": "python3-config",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/python3-config/1/json",
    "generated": "2026-05-30T06:05:31Z",
    "synopsis": "python-config  [  --prefix ] [ --exec-prefix ] [ --includes ] [ --libs ] [ --cflags ] [ --ld‐‐\nflags ] [ --extension-suffix ] [ --abiflags ] [ --help ]",
    "sections": {
        "NAME": {
            "content": "python-config - output build options for python C/C++ extensions or embedding\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "python-config  [  --prefix ] [ --exec-prefix ] [ --includes ] [ --libs ] [ --cflags ] [ --ld‐‐\nflags ] [ --extension-suffix ] [ --abiflags ] [ --help ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "python-config helps compiling and linking programs, which embed the  Python  interpreter,  or\nextension modules that can be loaded dynamically (at run time) into the interpreter.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "--abiflags",
                    "content": "print the the ABI flags as specified by PEP 3149.\n",
                    "long": "--abiflags"
                },
                {
                    "name": "--cflags",
                    "content": "print the C compiler flags.\n",
                    "long": "--cflags"
                },
                {
                    "name": "--ldflags",
                    "content": "print the flags that should be passed to the linker.\n",
                    "long": "--ldflags"
                },
                {
                    "name": "--includes",
                    "content": "similar to --cflags but only with -I options (path to python header files).\n\n--libs similar to --ldflags but only with -l options (used libraries).\n",
                    "long": "--includes"
                },
                {
                    "name": "--prefix",
                    "content": "prints the prefix (base directory) under which python can be found.\n",
                    "long": "--prefix"
                },
                {
                    "name": "--exec-prefix",
                    "content": "print the prefix used for executable program directories (such as bin, sbin, etc).\n",
                    "long": "--exec-prefix"
                },
                {
                    "name": "--extension-suffix",
                    "content": "print the extension suffix used for binary extensions.\n\n--help print the usage message.\n",
                    "long": "--extension-suffix"
                }
            ]
        },
        "EXAMPLES": {
            "content": "To build the singe-file c program prog against the python library, use\n\ngcc $(python-config --cflags --ldflags) progr.cpp -o progr.cpp\n\nThe same in a makefile:\n\nCFLAGS+=$(shell python-config --cflags)\nLDFLAGS+=$(shell python-config --ldflags)\nall: progr\n\nTo build a dynamically loadable python module, use\n\ngcc $(python-config --cflags --ldflags) -shared -fPIC progr.cpp -o progr.so\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "python (1)\nhttp://docs.python.org/extending/extending.html\n/usr/share/doc/python/faq/extending.html\n\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "This  manual  page  was  written by Johann Felix Soden <johfel@gmx.de> for the Debian project\n(and may be used by others).\n\n\n\nNovember 27, 2011                         PYTHON-CONFIG(1)",
            "subsections": []
        }
    },
    "summary": "python-config - output build options for python C/C++ extensions or embedding",
    "flags": [
        {
            "flag": "",
            "long": "--abiflags",
            "arg": null,
            "description": "print the the ABI flags as specified by PEP 3149."
        },
        {
            "flag": "",
            "long": "--cflags",
            "arg": null,
            "description": "print the C compiler flags."
        },
        {
            "flag": "",
            "long": "--ldflags",
            "arg": null,
            "description": "print the flags that should be passed to the linker."
        },
        {
            "flag": "",
            "long": "--includes",
            "arg": null,
            "description": "similar to --cflags but only with -I options (path to python header files). --libs similar to --ldflags but only with -l options (used libraries)."
        },
        {
            "flag": "",
            "long": "--prefix",
            "arg": null,
            "description": "prints the prefix (base directory) under which python can be found."
        },
        {
            "flag": "",
            "long": "--exec-prefix",
            "arg": null,
            "description": "print the prefix used for executable program directories (such as bin, sbin, etc)."
        },
        {
            "flag": "",
            "long": "--extension-suffix",
            "arg": null,
            "description": "print the extension suffix used for binary extensions. --help print the usage message."
        }
    ],
    "examples": [
        "To build the singe-file c program prog against the python library, use",
        "gcc $(python-config --cflags --ldflags) progr.cpp -o progr.cpp",
        "The same in a makefile:",
        "CFLAGS+=$(shell python-config --cflags)",
        "LDFLAGS+=$(shell python-config --ldflags)",
        "all: progr",
        "To build a dynamically loadable python module, use",
        "gcc $(python-config --cflags --ldflags) -shared -fPIC progr.cpp -o progr.so"
    ],
    "see_also": []
}