Differences between revisions 7 and 8
Revision 7 as of 2024-02-17 16:08:16
Size: 1592
Comment: Move pipx to another article
Revision 8 as of 2024-02-17 16:41:40
Size: 1744
Comment: See also
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
`pip(1)` is included in all Python installations. `pip(1)` is included in most Python installations. Some [[Linux]] and [[BSD]] distributions modify it.
Line 42: Line 42:
----



== See also ==

[[https://pip.pypa.io/en/stable/|Upstream project documentation]]

Python Pip

pip(1) is the primary package management toolchain for Python. Compare to pipx.


Installation

pip(1) is included in most Python installations. Some Linux and BSD distributions modify it.


Usage

On Linux and BSD distributions, there is typically a better solution for installing Python-based applications. Check your distribution's package manager first. Reasons being:

  • pip(1) installs globally by default, disallowing side-by-side installations of multiple Python applications unless they each use the same versions of all common dependencies

  • some distributions rely on the specific versions of Python libraries which may be overwritten or upgraded by pip(1)

There is always a better solution for installing Python libraries. See venv. Reasons being:

  • pip(1) installs globally by default, forcing simultaneous upgrade of all programs relying on a module

Global installation packages can be found in /usr/lib/python#.#/site-packages, with executable scripts typically added to /usr/bin.

To force user-only installation of a module or application, add the --user flag. Packages installed this way are found in ~/.local/lib/python#.#/site-packages, with executable scripts added to ~/.local/bin.

Configuration

Pip will by default noisily complain about the format of its output. To suppress the complaint without changing the output itself, explicitly set the default behavior:

export PIP_FORMAT=columns


See also

Upstream project documentation


CategoryRicottone

Python/Pip (last edited 2024-02-17 16:41:40 by DominicRicottone)