PipX

Version: 1.8.0 Linux MacOS

pipx is a tool to help you install and run end-user applications written in Python. It’s roughly similar to macOS’s brew, JavaScript’s npx, and Linux’s apt.

It’s closely related to pip. In fact, it uses pip, but is focused on installing and managing Python packages that can be run from the command line directly as applications. How is it Different from pip?

pip is a general-purpose package installer for both libraries and apps with no environment isolation. pipx is made specifically for application installation, as it adds isolation yet still makes the apps available in your shell: pipx creates an isolated environment for each application and its associated packages.

pipx does not ship with pip, but installing it is often an important part of bootstrapping your system. Where Does pipx Install Apps From?

By default, pipx uses the same package index as pip, PyPI. pipx can also install from all other sources pip can, such as a local directory, wheel, git url, etc.

Python and PyPI allow developers to distribute code with “console script entry points”. These entry points let users call into Python code from the command line, effectively acting like standalone applications.

pipx is a tool to install and run any of these thousands of application-containing packages in a safe, convenient, and reliable way. In a way, it turns Python Package Index (PyPI) into a big app store for Python applications. Not all Python packages have entry points, but many do.

If you would like to make your package compatible with pipx, all you need to do is add a console scripts entry point. If you’re a poetry user, use these instructions. Or, if you’re using hatch, try this. Features

pipx enables you to

Best of all, pipx runs with regular user permissions, never calling sudo pip install (you aren’t doing that, are you? 😄).

Installation Instructions

Linux
Depends on: python

Download Artefact
{
  "url": "{{ .SVar `.tool.pipx.download.url` }}",
  "destination_folder": "{{ .PDownloads }}",
  "output_filename": "{{ .SVar `.tool.pipx.download.filename` }}",
  "overwrite": false
}
Copy executable
{
  "source": "{{ .PDownloads }}/{{ .SVar `.tool.pipx.download.filename` }}",
  "destination": "{{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx.pyz"
}
Generate alias
{
  "contents": "#!/usr/bin/env bash\npython {{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx.pyz $*",
  "destination": "{{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx",
  "ignore_contents_merge": false
}
Make sure artefact is executable
{
  "path": "{{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx",
  "permission_bits": 504
}

MacOS
Depends on: python

Download Artefact
{
  "url": "{{ .SVar `.tool.pipx.download.url` }}",
  "destination_folder": "{{ .PDownloads }}",
  "output_filename": "{{ .SVar `.tool.pipx.download.filename` }}",
  "overwrite": false
}
Copy executable
{
  "source": "{{ .PDownloads }}/{{ .SVar `.tool.pipx.download.filename` }}",
  "destination": "{{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx.pyz"
}
Generate alias
{
  "contents": "#!/usr/bin/env bash\npython {{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx.pyz $*",
  "destination": "{{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx",
  "ignore_contents_merge": false
}
Make sure artefact is executable
{
  "path": "{{ .PTools }}/pipx/{{ .SVar `.tool.pipx.download.version` }}/pipx",
  "permission_bits": 504
}

Binaries