pipx — 在隔离的环境中安装和运行Python应用程序

pipx 介绍

在隔离的环境中安装和运行Python应用程序,安装的程序都在自己隔离的环境,不用考虑依赖冲突,且可以安装多个版本,可以非root身份运行程序。官网:https://github.com/pypa/pipx

安装 pipx

python3 -m pip install --user pipx

配置自动完成

pipx completions

使用 pipx 安装

pipx install pipenv

通过 url 安装

pipx install git+https://github.com/psf/black.git
pipx install git+https://github.com/psf/black.git@branch  # branch of your choice
pipx install git+https://github.com/psf/black.git@ce14fa8b497bae2b50ec48b3bd7022573a59cdb1  # git hash
pipx install https://github.com/psf/black/archive/18.9b0.zip  # install a release

列出已安装应用

pipx list

升级

pipx upgrade pipenv

运行

pipx run pipenv

指定版本运行

pipx run APP==1.0.0

通过 url 运行

pipx run https://gist.githubusercontent.com/cs01/fa721a17a326e551ede048c5088f9e0f/raw/6bdfbb6e9c1132b1c38fdd2f195d4a24c540c324/pipx-demo.py

卸载

pipx  uninstall pipenv

卸载所有

pipx  uninstall-all

显示帮助

pipx  -h