From 624fcdea3b45a12883677966675aad8b0b19f691 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Fri, 11 Nov 2022 01:25:46 +0800 Subject: [PATCH] chapter08: add pip --- chapter08/chapter08.xml | 1 + chapter08/pip.xml | 132 ++++++++++++++++++++++++++++++++++++++++ packages.ent | 2 + 3 files changed, 135 insertions(+) create mode 100644 chapter08/pip.xml diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml index fb0d2a44c..a5de5bd26 100644 --- a/chapter08/chapter08.xml +++ b/chapter08/chapter08.xml @@ -65,6 +65,7 @@ + diff --git a/chapter08/pip.xml b/chapter08/pip.xml new file mode 100644 index 000000000..5d3861f1c --- /dev/null +++ b/chapter08/pip.xml @@ -0,0 +1,132 @@ + + + %general-entities; +]> + + + + + + pip + &pip-version; +
&pip-url;
+
+ + Pip-&pip-version; + + + pip + + + + + + <para>Pip is the PyPA recommended tool for installing Python packages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + <seglistitem> + <seg>&pip-fin-sbu;</seg> + <seg>&pip-fin-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Pip + + Remove useless Windows PE executables: + +find -name \*.exe -delete +sed '/\.exe/d' -i setup.py + + Disable the installation of unversioned pip + script, to prevent a potential conflict if Python 2 will be installed + later (in BLFS): + +sed '/pip=/d' -i setup.py + + Build the pip package. The building process needs pip itself, + set PYTHONPATH so python3 will be able + to find it: + +PYTHONPATH=src \ +python3 -m pip wheel -w dist --no-build-isolation --no-deps $PWD + + Install pip with the following command: + +PYTHONPATH=src \ +python&python-minor; -m pip install --no-index --find-links dist pip --force-reinstall + + + The meaning of the install command: + + + python&python-minor; + + It's used instead of python3, to ensure + the name of Python interpreter in the installed + pip3.11 script to be + python&python-minor;. + + + + + + + Contents of Pip + + + Installed program + Installed directories + + + pip3 and pip&python-minor; + + /usr/lib/python&python-minor;/site-packages/pip and + /usr/lib/python&python-minor;/site-packages/pip-&pip-version;.dist-info + + + + + + Short Descriptions + + + + + pip3 + + + The package installer for Python. You can use pip to install + packages from Python Package Index and other indexes + + + pip3 + + + + + + pip&python-minor; + + + Another copy of pip3, can be used to manage + Python modules for Python-&python-minor; if a new Python 3 minor + version is installed. + + + pip3 + + + + + + + +
+ diff --git a/packages.ent b/packages.ent index 8ebefb88c..d21e15b9b 100644 --- a/packages.ent +++ b/packages.ent @@ -607,6 +607,8 @@ + +