summaryrefslogtreecommitdiff
path: root/devdocs/python~3.12/library%2Fsysconfig.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/python~3.12/library%2Fsysconfig.html
new repository
Diffstat (limited to 'devdocs/python~3.12/library%2Fsysconfig.html')
-rw-r--r--devdocs/python~3.12/library%2Fsysconfig.html147
1 files changed, 147 insertions, 0 deletions
diff --git a/devdocs/python~3.12/library%2Fsysconfig.html b/devdocs/python~3.12/library%2Fsysconfig.html
new file mode 100644
index 00000000..9b041979
--- /dev/null
+++ b/devdocs/python~3.12/library%2Fsysconfig.html
@@ -0,0 +1,147 @@
+ <span id="sysconfig-provide-access-to-python-s-configuration-information"></span><h1>sysconfig — Provide access to Python’s configuration information</h1> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/sysconfig.py">Lib/sysconfig.py</a></p> <p>The <a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> module provides access to Python’s configuration information like the list of installation paths and the configuration variables relevant for the current platform.</p> <section id="configuration-variables"> <h2>Configuration variables</h2> <p>A Python distribution contains a <code>Makefile</code> and a <code>pyconfig.h</code> header file that are necessary to build both the Python binary itself and third-party C extensions compiled using <code>setuptools</code>.</p> <p><a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> puts all variables found in these files in a dictionary that can be accessed using <a class="reference internal" href="#sysconfig.get_config_vars" title="sysconfig.get_config_vars"><code>get_config_vars()</code></a> or <a class="reference internal" href="#sysconfig.get_config_var" title="sysconfig.get_config_var"><code>get_config_var()</code></a>.</p> <p>Notice that on Windows, it’s a much smaller set.</p> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_config_vars">
+<code>sysconfig.get_config_vars(*args)</code> </dt> <dd>
+<p>With no arguments, return a dictionary of all configuration variables relevant for the current platform.</p> <p>With arguments, return a list of values that result from looking up each argument in the configuration variable dictionary.</p> <p>For each argument, if the value is not found, return <code>None</code>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_config_var">
+<code>sysconfig.get_config_var(name)</code> </dt> <dd>
+<p>Return the value of a single variable <em>name</em>. Equivalent to <code>get_config_vars().get(name)</code>.</p> <p>If <em>name</em> is not found, return <code>None</code>.</p> </dd>
+</dl> <p>Example of usage:</p> <pre data-language="python">&gt;&gt;&gt; import sysconfig
+&gt;&gt;&gt; sysconfig.get_config_var('Py_ENABLE_SHARED')
+0
+&gt;&gt;&gt; sysconfig.get_config_var('LIBDIR')
+'/usr/local/lib'
+&gt;&gt;&gt; sysconfig.get_config_vars('AR', 'CXX')
+['ar', 'g++']
+</pre> </section> <section id="installation-paths"> <span id="id1"></span><h2>Installation paths</h2> <p>Python uses an installation scheme that differs depending on the platform and on the installation options. These schemes are stored in <a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> under unique identifiers based on the value returned by <a class="reference internal" href="os#os.name" title="os.name"><code>os.name</code></a>. The schemes are used by package installers to determine where to copy files to.</p> <p>Python currently supports nine schemes:</p> <ul class="simple"> <li>
+<em>posix_prefix</em>: scheme for POSIX platforms like Linux or macOS. This is the default scheme used when Python or a component is installed.</li> <li>
+<em>posix_home</em>: scheme for POSIX platforms, when the <em>home</em> option is used. This scheme defines paths located under a specific home prefix.</li> <li>
+<em>posix_user</em>: scheme for POSIX platforms, when the <em>user</em> option is used. This scheme defines paths located under the user’s home directory (<a class="reference internal" href="site#site.USER_BASE" title="site.USER_BASE"><code>site.USER_BASE</code></a>).</li> <li>
+<em>posix_venv</em>: scheme for <a class="reference internal" href="venv#module-venv" title="venv: Creation of virtual environments."><code>Python virtual environments</code></a> on POSIX platforms; by default it is the same as <em>posix_prefix</em>.</li> <li>
+<em>nt</em>: scheme for Windows. This is the default scheme used when Python or a component is installed.</li> <li>
+<em>nt_user</em>: scheme for Windows, when the <em>user</em> option is used.</li> <li>
+<em>nt_venv</em>: scheme for <a class="reference internal" href="venv#module-venv" title="venv: Creation of virtual environments."><code>Python virtual environments</code></a> on Windows; by default it is the same as <em>nt</em>.</li> <li>
+<em>venv</em>: a scheme with values from either <em>posix_venv</em> or <em>nt_venv</em> depending on the platform Python runs on.</li> <li>
+<em>osx_framework_user</em>: scheme for macOS, when the <em>user</em> option is used.</li> </ul> <p>Each scheme is itself composed of a series of paths and each path has a unique identifier. Python currently uses eight paths:</p> <ul class="simple"> <li>
+<em>stdlib</em>: directory containing the standard Python library files that are not platform-specific.</li> <li>
+<em>platstdlib</em>: directory containing the standard Python library files that are platform-specific.</li> <li>
+<em>platlib</em>: directory for site-specific, platform-specific files.</li> <li>
+<em>purelib</em>: directory for site-specific, non-platform-specific files (‘pure’ Python).</li> <li>
+<em>include</em>: directory for non-platform-specific header files for the Python C-API.</li> <li>
+<em>platinclude</em>: directory for platform-specific header files for the Python C-API.</li> <li>
+<em>scripts</em>: directory for script files.</li> <li>
+<em>data</em>: directory for data files.</li> </ul> </section> <section id="user-scheme"> <span id="sysconfig-user-scheme"></span><h2>User scheme</h2> <p>This scheme is designed to be the most convenient solution for users that don’t have write permission to the global site-packages directory or don’t want to install into it.</p> <p>Files will be installed into subdirectories of <a class="reference internal" href="site#site.USER_BASE" title="site.USER_BASE"><code>site.USER_BASE</code></a> (written as <code><em>userbase</em></code> hereafter). This scheme installs pure Python modules and extension modules in the same location (also known as <a class="reference internal" href="site#site.USER_SITE" title="site.USER_SITE"><code>site.USER_SITE</code></a>).</p> <section id="posix-user"> <h3><code>posix_user</code></h3> <table class="docutils align-default"> <thead> <tr>
+<th class="head"><p>Path</p></th> <th class="head"><p>Installation directory</p></th> </tr> </thead> <tr>
+<td><p><em>stdlib</em></p></td> <td><p><code><em>userbase</em>/lib/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>platstdlib</em></p></td> <td><p><code><em>userbase</em>/lib/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>platlib</em></p></td> <td><p><code><em>userbase</em>/lib/python<em>X.Y</em>/site-packages</code></p></td> </tr> <tr>
+<td><p><em>purelib</em></p></td> <td><p><code><em>userbase</em>/lib/python<em>X.Y</em>/site-packages</code></p></td> </tr> <tr>
+<td><p><em>include</em></p></td> <td><p><code><em>userbase</em>/include/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>scripts</em></p></td> <td><p><code><em>userbase</em>/bin</code></p></td> </tr> <tr>
+<td><p><em>data</em></p></td> <td><p><code><em>userbase</em></code></p></td> </tr> </table> </section> <section id="nt-user"> <h3><code>nt_user</code></h3> <table class="docutils align-default"> <thead> <tr>
+<th class="head"><p>Path</p></th> <th class="head"><p>Installation directory</p></th> </tr> </thead> <tr>
+<td><p><em>stdlib</em></p></td> <td><p><code><em>userbase</em>\Python<em>XY</em></code></p></td> </tr> <tr>
+<td><p><em>platstdlib</em></p></td> <td><p><code><em>userbase</em>\Python<em>XY</em></code></p></td> </tr> <tr>
+<td><p><em>platlib</em></p></td> <td><p><code><em>userbase</em>\Python<em>XY</em>\site-packages</code></p></td> </tr> <tr>
+<td><p><em>purelib</em></p></td> <td><p><code><em>userbase</em>\Python<em>XY</em>\site-packages</code></p></td> </tr> <tr>
+<td><p><em>include</em></p></td> <td><p><code><em>userbase</em>\Python<em>XY</em>\Include</code></p></td> </tr> <tr>
+<td><p><em>scripts</em></p></td> <td><p><code><em>userbase</em>\Python<em>XY</em>\Scripts</code></p></td> </tr> <tr>
+<td><p><em>data</em></p></td> <td><p><code><em>userbase</em></code></p></td> </tr> </table> </section> <section id="osx-framework-user"> <h3><code>osx_framework_user</code></h3> <table class="docutils align-default"> <thead> <tr>
+<th class="head"><p>Path</p></th> <th class="head"><p>Installation directory</p></th> </tr> </thead> <tr>
+<td><p><em>stdlib</em></p></td> <td><p><code><em>userbase</em>/lib/python</code></p></td> </tr> <tr>
+<td><p><em>platstdlib</em></p></td> <td><p><code><em>userbase</em>/lib/python</code></p></td> </tr> <tr>
+<td><p><em>platlib</em></p></td> <td><p><code><em>userbase</em>/lib/python/site-packages</code></p></td> </tr> <tr>
+<td><p><em>purelib</em></p></td> <td><p><code><em>userbase</em>/lib/python/site-packages</code></p></td> </tr> <tr>
+<td><p><em>include</em></p></td> <td><p><code><em>userbase</em>/include/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>scripts</em></p></td> <td><p><code><em>userbase</em>/bin</code></p></td> </tr> <tr>
+<td><p><em>data</em></p></td> <td><p><code><em>userbase</em></code></p></td> </tr> </table> </section> </section> <section id="home-scheme"> <span id="sysconfig-home-scheme"></span><h2>Home scheme</h2> <p>The idea behind the “home scheme” is that you build and maintain a personal stash of Python modules. This scheme’s name is derived from the idea of a “home” directory on Unix, since it’s not unusual for a Unix user to make their home directory have a layout similar to <code>/usr/</code> or <code>/usr/local/</code>. This scheme can be used by anyone, regardless of the operating system they are installing for.</p> <section id="posix-home"> <h3><code>posix_home</code></h3> <table class="docutils align-default"> <thead> <tr>
+<th class="head"><p>Path</p></th> <th class="head"><p>Installation directory</p></th> </tr> </thead> <tr>
+<td><p><em>stdlib</em></p></td> <td><p><code><em>home</em>/lib/python</code></p></td> </tr> <tr>
+<td><p><em>platstdlib</em></p></td> <td><p><code><em>home</em>/lib/python</code></p></td> </tr> <tr>
+<td><p><em>platlib</em></p></td> <td><p><code><em>home</em>/lib/python</code></p></td> </tr> <tr>
+<td><p><em>purelib</em></p></td> <td><p><code><em>home</em>/lib/python</code></p></td> </tr> <tr>
+<td><p><em>include</em></p></td> <td><p><code><em>home</em>/include/python</code></p></td> </tr> <tr>
+<td><p><em>platinclude</em></p></td> <td><p><code><em>home</em>/include/python</code></p></td> </tr> <tr>
+<td><p><em>scripts</em></p></td> <td><p><code><em>home</em>/bin</code></p></td> </tr> <tr>
+<td><p><em>data</em></p></td> <td><p><code><em>home</em></code></p></td> </tr> </table> </section> </section> <section id="prefix-scheme"> <span id="sysconfig-prefix-scheme"></span><h2>Prefix scheme</h2> <p>The “prefix scheme” is useful when you wish to use one Python installation to perform the build/install (i.e., to run the setup script), but install modules into the third-party module directory of a different Python installation (or something that looks like a different Python installation). If this sounds a trifle unusual, it is—that’s why the user and home schemes come before. However, there are at least two known cases where the prefix scheme will be useful.</p> <p>First, consider that many Linux distributions put Python in <code>/usr</code>, rather than the more traditional <code>/usr/local</code>. This is entirely appropriate, since in those cases Python is part of “the system” rather than a local add-on. However, if you are installing Python modules from source, you probably want them to go in <code>/usr/local/lib/python2.<em>X</em></code> rather than <code>/usr/lib/python2.<em>X</em></code>.</p> <p>Another possibility is a network filesystem where the name used to write to a remote directory is different from the name used to read it: for example, the Python interpreter accessed as <code>/usr/local/bin/python</code> might search for modules in <code>/usr/local/lib/python2.<em>X</em></code>, but those modules would have to be installed to, say, <code>/mnt/<em>@server</em>/export/lib/python2.<em>X</em></code>.</p> <section id="posix-prefix"> <h3><code>posix_prefix</code></h3> <table class="docutils align-default"> <thead> <tr>
+<th class="head"><p>Path</p></th> <th class="head"><p>Installation directory</p></th> </tr> </thead> <tr>
+<td><p><em>stdlib</em></p></td> <td><p><code><em>prefix</em>/lib/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>platstdlib</em></p></td> <td><p><code><em>prefix</em>/lib/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>platlib</em></p></td> <td><p><code><em>prefix</em>/lib/python<em>X.Y</em>/site-packages</code></p></td> </tr> <tr>
+<td><p><em>purelib</em></p></td> <td><p><code><em>prefix</em>/lib/python<em>X.Y</em>/site-packages</code></p></td> </tr> <tr>
+<td><p><em>include</em></p></td> <td><p><code><em>prefix</em>/include/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>platinclude</em></p></td> <td><p><code><em>prefix</em>/include/python<em>X.Y</em></code></p></td> </tr> <tr>
+<td><p><em>scripts</em></p></td> <td><p><code><em>prefix</em>/bin</code></p></td> </tr> <tr>
+<td><p><em>data</em></p></td> <td><p><code><em>prefix</em></code></p></td> </tr> </table> </section> <section id="nt"> <h3><code>nt</code></h3> <table class="docutils align-default"> <thead> <tr>
+<th class="head"><p>Path</p></th> <th class="head"><p>Installation directory</p></th> </tr> </thead> <tr>
+<td><p><em>stdlib</em></p></td> <td><p><code><em>prefix</em>\Lib</code></p></td> </tr> <tr>
+<td><p><em>platstdlib</em></p></td> <td><p><code><em>prefix</em>\Lib</code></p></td> </tr> <tr>
+<td><p><em>platlib</em></p></td> <td><p><code><em>prefix</em>\Lib\site-packages</code></p></td> </tr> <tr>
+<td><p><em>purelib</em></p></td> <td><p><code><em>prefix</em>\Lib\site-packages</code></p></td> </tr> <tr>
+<td><p><em>include</em></p></td> <td><p><code><em>prefix</em>\Include</code></p></td> </tr> <tr>
+<td><p><em>platinclude</em></p></td> <td><p><code><em>prefix</em>\Include</code></p></td> </tr> <tr>
+<td><p><em>scripts</em></p></td> <td><p><code><em>prefix</em>\Scripts</code></p></td> </tr> <tr>
+<td><p><em>data</em></p></td> <td><p><code><em>prefix</em></code></p></td> </tr> </table> </section> </section> <section id="installation-path-functions"> <h2>Installation path functions</h2> <p><a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> provides some functions to determine these installation paths.</p> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_scheme_names">
+<code>sysconfig.get_scheme_names()</code> </dt> <dd>
+<p>Return a tuple containing all schemes currently supported in <a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_default_scheme">
+<code>sysconfig.get_default_scheme()</code> </dt> <dd>
+<p>Return the default scheme name for the current platform.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10: </span>This function was previously named <code>_get_default_scheme()</code> and considered an implementation detail.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.11: </span>When Python runs from a virtual environment, the <em>venv</em> scheme is returned.</p> </div> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_preferred_scheme">
+<code>sysconfig.get_preferred_scheme(key)</code> </dt> <dd>
+<p>Return a preferred scheme name for an installation layout specified by <em>key</em>.</p> <p><em>key</em> must be either <code>"prefix"</code>, <code>"home"</code>, or <code>"user"</code>.</p> <p>The return value is a scheme name listed in <a class="reference internal" href="#sysconfig.get_scheme_names" title="sysconfig.get_scheme_names"><code>get_scheme_names()</code></a>. It can be passed to <a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> functions that take a <em>scheme</em> argument, such as <a class="reference internal" href="#sysconfig.get_paths" title="sysconfig.get_paths"><code>get_paths()</code></a>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.11: </span>When Python runs from a virtual environment and <code>key="prefix"</code>, the <em>venv</em> scheme is returned.</p> </div> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig._get_preferred_schemes">
+<code>sysconfig._get_preferred_schemes()</code> </dt> <dd>
+<p>Return a dict containing preferred scheme names on the current platform. Python implementers and redistributors may add their preferred schemes to the <code>_INSTALL_SCHEMES</code> module-level global value, and modify this function to return those scheme names, to e.g. provide different schemes for system and language package managers to use, so packages installed by either do not mix with those by the other.</p> <p>End users should not use this function, but <a class="reference internal" href="#sysconfig.get_default_scheme" title="sysconfig.get_default_scheme"><code>get_default_scheme()</code></a> and <a class="reference internal" href="#sysconfig.get_preferred_scheme" title="sysconfig.get_preferred_scheme"><code>get_preferred_scheme()</code></a> instead.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_path_names">
+<code>sysconfig.get_path_names()</code> </dt> <dd>
+<p>Return a tuple containing all path names currently supported in <a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_path">
+<code>sysconfig.get_path(name[, scheme[, vars[, expand]]])</code> </dt> <dd>
+<p>Return an installation path corresponding to the path <em>name</em>, from the install scheme named <em>scheme</em>.</p> <p><em>name</em> has to be a value from the list returned by <a class="reference internal" href="#sysconfig.get_path_names" title="sysconfig.get_path_names"><code>get_path_names()</code></a>.</p> <p><a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> stores installation paths corresponding to each path name, for each platform, with variables to be expanded. For instance the <em>stdlib</em> path for the <em>nt</em> scheme is: <code>{base}/Lib</code>.</p> <p><a class="reference internal" href="#sysconfig.get_path" title="sysconfig.get_path"><code>get_path()</code></a> will use the variables returned by <a class="reference internal" href="#sysconfig.get_config_vars" title="sysconfig.get_config_vars"><code>get_config_vars()</code></a> to expand the path. All variables have default values for each platform so one may call this function and get the default value.</p> <p>If <em>scheme</em> is provided, it must be a value from the list returned by <a class="reference internal" href="#sysconfig.get_scheme_names" title="sysconfig.get_scheme_names"><code>get_scheme_names()</code></a>. Otherwise, the default scheme for the current platform is used.</p> <p>If <em>vars</em> is provided, it must be a dictionary of variables that will update the dictionary returned by <a class="reference internal" href="#sysconfig.get_config_vars" title="sysconfig.get_config_vars"><code>get_config_vars()</code></a>.</p> <p>If <em>expand</em> is set to <code>False</code>, the path will not be expanded using the variables.</p> <p>If <em>name</em> is not found, raise a <a class="reference internal" href="exceptions#KeyError" title="KeyError"><code>KeyError</code></a>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_paths">
+<code>sysconfig.get_paths([scheme[, vars[, expand]]])</code> </dt> <dd>
+<p>Return a dictionary containing all installation paths corresponding to an installation scheme. See <a class="reference internal" href="#sysconfig.get_path" title="sysconfig.get_path"><code>get_path()</code></a> for more information.</p> <p>If <em>scheme</em> is not provided, will use the default scheme for the current platform.</p> <p>If <em>vars</em> is provided, it must be a dictionary of variables that will update the dictionary used to expand the paths.</p> <p>If <em>expand</em> is set to false, the paths will not be expanded.</p> <p>If <em>scheme</em> is not an existing scheme, <a class="reference internal" href="#sysconfig.get_paths" title="sysconfig.get_paths"><code>get_paths()</code></a> will raise a <a class="reference internal" href="exceptions#KeyError" title="KeyError"><code>KeyError</code></a>.</p> </dd>
+</dl> </section> <section id="other-functions"> <h2>Other functions</h2> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_python_version">
+<code>sysconfig.get_python_version()</code> </dt> <dd>
+<p>Return the <code>MAJOR.MINOR</code> Python version number as a string. Similar to <code>'%d.%d' % sys.version_info[:2]</code>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_platform">
+<code>sysconfig.get_platform()</code> </dt> <dd>
+<p>Return a string that identifies the current platform.</p> <p>This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by ‘os.uname()’), although the exact information included depends on the OS; e.g., on Linux, the kernel version isn’t particularly important.</p> <p>Examples of returned values:</p> <ul class="simple"> <li>linux-i586</li> <li>linux-alpha (?)</li> <li>solaris-2.6-sun4u</li> </ul> <p>Windows will return one of:</p> <ul class="simple"> <li>win-amd64 (64bit Windows on AMD64, aka x86_64, Intel64, and EM64T)</li> <li>win32 (all others - specifically, sys.platform is returned)</li> </ul> <p>macOS can return:</p> <ul class="simple"> <li>macosx-10.6-ppc</li> <li>macosx-10.4-ppc64</li> <li>macosx-10.3-i386</li> <li>macosx-10.4-fat</li> </ul> <p>For other non-POSIX platforms, currently just returns <a class="reference internal" href="sys#sys.platform" title="sys.platform"><code>sys.platform</code></a>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.is_python_build">
+<code>sysconfig.is_python_build()</code> </dt> <dd>
+<p>Return <code>True</code> if the running Python interpreter was built from source and is being run from its built location, and not from a location resulting from e.g. running <code>make install</code> or installing via a binary installer.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.parse_config_h">
+<code>sysconfig.parse_config_h(fp[, vars])</code> </dt> <dd>
+<p>Parse a <code>config.h</code>-style file.</p> <p><em>fp</em> is a file-like object pointing to the <code>config.h</code>-like file.</p> <p>A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary, and updated with the values read in the file.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_config_h_filename">
+<code>sysconfig.get_config_h_filename()</code> </dt> <dd>
+<p>Return the path of <code>pyconfig.h</code>.</p> </dd>
+</dl> <dl class="py function"> <dt class="sig sig-object py" id="sysconfig.get_makefile_filename">
+<code>sysconfig.get_makefile_filename()</code> </dt> <dd>
+<p>Return the path of <code>Makefile</code>.</p> </dd>
+</dl> </section> <section id="using-sysconfig-as-a-script"> <span id="sysconfig-cli"></span><h2>Using sysconfig as a script</h2> <p>You can use <a class="reference internal" href="#module-sysconfig" title="sysconfig: Python's configuration information"><code>sysconfig</code></a> as a script with Python’s <em>-m</em> option:</p> <pre data-language="shell">$ python -m sysconfig
+Platform: "macosx-10.4-i386"
+Python version: "3.2"
+Current installation scheme: "posix_prefix"
+
+Paths:
+ data = "/usr/local"
+ include = "/Users/tarek/Dev/svn.python.org/py3k/Include"
+ platinclude = "."
+ platlib = "/usr/local/lib/python3.2/site-packages"
+ platstdlib = "/usr/local/lib/python3.2"
+ purelib = "/usr/local/lib/python3.2/site-packages"
+ scripts = "/usr/local/bin"
+ stdlib = "/usr/local/lib/python3.2"
+
+Variables:
+ AC_APPLE_UNIVERSAL_BUILD = "0"
+ AIX_GENUINE_CPLUSPLUS = "0"
+ AR = "ar"
+ ARFLAGS = "rc"
+ ...
+</pre> <p>This call will print in the standard output the information returned by <a class="reference internal" href="#sysconfig.get_platform" title="sysconfig.get_platform"><code>get_platform()</code></a>, <a class="reference internal" href="#sysconfig.get_python_version" title="sysconfig.get_python_version"><code>get_python_version()</code></a>, <a class="reference internal" href="#sysconfig.get_path" title="sysconfig.get_path"><code>get_path()</code></a> and <a class="reference internal" href="#sysconfig.get_config_vars" title="sysconfig.get_config_vars"><code>get_config_vars()</code></a>.</p> </section> <div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2001&ndash;2023 Python Software Foundation<br>Licensed under the PSF License.<br>
+ <a href="https://docs.python.org/3.12/library/sysconfig.html" class="_attribution-link">https://docs.python.org/3.12/library/sysconfig.html</a>
+ </p>
+</div>