Lines Matching +full:- +full:- +full:base +full:- +full:directory
1 :mod:`site` --- Site-specific configuration hook
5 :synopsis: Module responsible for site-specific configuration.
9 --------------
14 import can be suppressed using the interpreter's :option:`-S` option.
18 Importing this module will append site-specific paths to the module search path
19 and add a few builtins, unless :option:`-S` was used. In that case, this module
21 or additions to the builtins. To explicitly trigger the usual site-specific
26 :option:`-S`.
29 pair: site-packages; directory
34 :file:`lib/site-packages` (on Windows) or
35 :file:`lib/python{X.Y}/site-packages` (on Unix and macOS). For each
36 of the distinct head-tail combinations, it sees if it refers to an existing
37 directory, and if so, adds it to ``sys.path`` and also inspects the newly
41 Support for the "site-python" directory has been removed.
43 If a file named "pyvenv.cfg" exists one directory above sys.executable,
44 sys.prefix and sys.exec_prefix are set to that directory and
45 it is also checked for site-packages (sys.base_prefix and
48 the key "include-system-site-packages" set to anything other than "true"
49 (case-insensitive), the system-level prefixes will not be
50 searched for site-packages; otherwise they will.
58 additional items (one per line) to be added to ``sys.path``. Non-existing items
60 directory rather than a file. No item is added to ``sys.path`` more than
71 (load 3rd-party import hooks, adjust :envvar:`PATH` etc).
84 a subdirectory :file:`/usr/local/lib/python{X.Y}/site-packages` with three
101 Then the following version-specific directories are added to
104 /usr/local/lib/pythonX.Y/site-packages/bar
105 /usr/local/lib/pythonX.Y/site-packages/foo
108 directory precedes the :file:`foo` directory because :file:`bar.pth` comes
115 :mod:`sitecustomize`, which can perform arbitrary site-specific customizations.
116 It is typically created by a system administrator in the site-packages
117 directory. If this import fails with an :exc:`ImportError` or its subclass
127 which can perform arbitrary user-specific customizations, if
129 user site-packages directory (see below), which is part of ``sys.path`` unless
130 disabled by :option:`-s`. If this import fails with an :exc:`ImportError` or
134 Note that for some non-Unix systems, ``sys.prefix`` and ``sys.exec_prefix`` are
139 .. _rlcompleter-config:
142 ----------------------
146 :ref:`interactive mode <tut-interactive>` and without the :option:`-S` option.
147 The default behavior is enable tab-completion and to use
158 ---------------
162 A list of prefixes for site-packages directories.
167 Flag showing the status of the user site-packages directory. ``True`` means
169 was disabled by user request (with :option:`-s` or
177 Path to the user site-packages for the running Python. Can be ``None`` if
179 :file:`~/.local/lib/python{X.Y}/site-packages` for UNIX and non-framework
180 macOS builds, :file:`~/Library/Python/{X.Y}/lib/python/site-packages` for macOS
181 framework builds, and :file:`{%APPDATA%}\\Python\\Python{XY}\\site-packages`
182 on Windows. This directory is a site directory, which means that
188 Path to the base directory for the user site-packages. Can be ``None`` if
190 :file:`~/.local` for UNIX and macOS non-framework builds,
194 etc. for the :ref:`user installation scheme <inst-alt-install-user>`.
200 Adds all the standard site-specific directories to the module search
202 unless the Python interpreter was started with the :option:`-S` flag.
210 Add a directory to sys.path and process its :file:`.pth` files. Typically
216 Return a list containing all global site-packages directories.
223 Return the path of the user base directory, :data:`USER_BASE`. If it is not
232 Return the path of the user-specific site-packages directory,
234 it, respecting :data:`USER_BASE`. To determine if the user-specific
235 site-packages was added to ``sys.path`` :data:`ENABLE_USER_SITE` should be
241 .. _site-commandline:
244 ----------------------
251 .. code-block:: shell-session
253 $ python3 -m site --user-site
254 /home/user/.local/lib/python3.3/site-packages
258 :data:`USER_BASE` and whether the directory exists, then the same thing for
261 .. cmdoption:: --user-base
263 Print the path to the user base directory.
265 .. cmdoption:: --user-site
267 Print the path to the user site-packages directory.
269 If both options are given, user base and user site will be printed (always in
273 the user site-packages directory is enabled, ``1`` if it was disabled by the
279 * :pep:`370` -- Per user site-packages directory
280 * :ref:`sys-path-init` -- The initialization of :data:`sys.path`.