Skip to content

pipx Backend

You may install python packages directly from:

  • PyPI
  • Git
  • GitHub
  • Http

The code for this is inside of the mise repository at ./src/backend/pipx.rs.

Dependencies

This relies on having pipx installed. You can install it with or without mise. Here is how to install pipx with mise:

sh
mise use -g python
pip install --user pipx

Other installation instructions can be found here

Usage

The following installs the latest version of black and sets it as the active version on PATH:

sh
$ mise use -g pipx:psf/black
$ black --version
black, 24.3.0

The version will be set in ~/.config/mise/config.toml with the following format:

toml
[tools]
"pipx:psf/black" = "latest"

Python upgrades

If the python version used by a pipx package changes, (by mise or system python), you may need to reinstall the package. This can be done with:

sh
mise install -f pipx:psf/black

Or you can reinstall all pipx packages with:

sh
mise install -f "pipx:*"

mise should do this automatically when using mise up python.

Supported Pipx Syntax

DescriptionUsage
PyPI shorthand latest versionpipx:black
PyPI shorthand for specific versionpipx:[email protected]
GitHub shorthand for latest versionpipx:psf/black
GitHub shorthand for specific versionpipx:psf/[email protected]
Git syntax for latest versionpipx:git+https://github.com/psf/black.git
Git syntax for a branchpipx:git+https://github.com/psf/black.git@main
Https with zipfilepipx:https://github.com/psf/black/archive/18.9b0.zip

Other syntax may work but is unsupported and untested.

Settings

Set these with mise settings set [VARIABLE] [VALUE] or by setting the environment variable listed.

pipx.uvx

  • Type: Bool
  • Env: MISE_PIPX_UVX
  • Default: true

If true, mise will use uvx instead of pipx if uv is installed and on PATH. This makes installing CLIs much faster by using uv as the package manager.

You can install it with mise:

mise use -g uv

Tool Options

The following tool-options are available for the pipx backend—these go in [tools] in mise.toml.

extras

Install additional components.

toml
[tools]
"pipx:harlequin" = { version = "latest", extras = "postgres,s3" }

pipx_args

Additional arguments to pass to pipx when installing the package.

toml
[tools]
"pipx:black" = { version = "latest", pipx_args = "--preinstall" }

uvx_args

Additional arguments to pass to uvx when installing the package.

toml
[tools]
"pipx:ansible-core" = { version = "latest", uvx_args = "--with ansible" }

Licensed under the MIT License. Maintained by @jdx and friends.