Skip to content

Commit 62bca3f

Browse files
committed
DOC: document include-system-site-packages interaction with usersite
It is not otherwise documented that this implicitly disables user site-packages.
1 parent 72a2678 commit 62bca3f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Doc/library/site.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ When running under a :ref:`virtual environment <sys-path-init-virtual-environmen
6464
the ``pyvenv.cfg`` file in :data:`sys.prefix` is checked for site-specific
6565
configurations. If the ``include-system-site-packages`` key exists and is set to
6666
``true`` (case-insensitive), the system-level prefixes will be searched for
67-
site-packages, otherwise they won't.
67+
site-packages, otherwise they won't. If the system-level prefixes are not searched then
68+
the user site prefixes are also implicitly not searched for site-packages.
6869

6970
.. index::
7071
single: # (hash); comment

Lib/site.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
installation). If "pyvenv.cfg" (a bootstrap configuration file) contains
2121
the key "include-system-site-packages" is set to "true"
2222
(case-insensitive), the system-level prefixes will still also be
23-
searched for site-packages; otherwise they won't.
23+
searched for site-packages; otherwise they won't. If the system-level
24+
prefixes are not included then the user site prefixes are also implicitly
25+
not searched for site-packages.
2426
2527
All of the resulting site-specific directories, if they exist, are
2628
appended to sys.path, and also inspected for path configuration

0 commit comments

Comments
 (0)