aboutsummaryrefslogtreecommitdiffstats
path: root/chapter08/python.xml
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2022-04-17 12:55:48 -0500
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2022-04-17 12:55:48 -0500
commite9538133fa6c5dd2a6afdd5521b507fa5229fddc (patch)
treeec1420b791120563e3a6c736de69b908fd1e7fa8 /chapter08/python.xml
parent75bab32f8333e8214c4ff97f26b8a043095e097a (diff)
Suppress a waring if running pip3 as root.
In serveral places we use the pip3 command to install Python 3 programs and modules for all users as root. This conflicts with the Python developers' recommendation to build packages in a virtual environment as a regular user. To this end, a multi-line warning is written when using pip3 as the root user. This change shows users how to avoid this warning.
Diffstat (limited to 'chapter08/python.xml')
-rw-r--r--chapter08/python.xml12
1 files changed, 12 insertions, 0 deletions
diff --git a/chapter08/python.xml b/chapter08/python.xml
index 6b12d3559..76530d782 100644
--- a/chapter08/python.xml
+++ b/chapter08/python.xml
@@ -92,6 +92,18 @@
<screen><userinput remap="install">make install</userinput></screen>
+ <para>In serveral places we use the <command>pip3</command> command to
+ install Python 3 programs and modules for all users as root. This conflicts
+ with the Python developers recommendation to build packages in a virtual
+ environment as a regular user. To this end, a multi-line warning is
+ written when using <command>pip3</command> as the root user. If desired,
+ supress this warning by running the following command:</para>
+
+<screen><userinput remap="install">sed -e '/def warn_if_run_as_root/a\ return' \
+ -i /usr/lib/python3.10/site-packages/pip/_internal/cli/req_command.py
+</userinput></screen>
+
+
<para>If desired, install the preformatted documentation:</para>
<screen><userinput remap="install">install -v -dm755 /usr/share/doc/python-&python-version;/html