An experimental "pip" subcommand for the Python Launcher for Unix
- Use pip with the Python interpreter that would be selected by the Launcher
- Automatically create a minimal virtual environment if one does not exist
- Update pip automatically
- Keep a single copy of pip
Simply download a py-pip.pyz
file from any of the releases.
If you want to build a py-pip.pyz
from source, run nox build
and find the file in the dist
directory.
If you make py-pip.pyz
executable, you can run it directly like it was pip
, passing arguments to it that pip itself would accept.
py-pip.pyz <pip arguments>
This causes several things to happen:
- The Python Launcher is used to find the appropriate Python interpreter to use
- If
~/.cache/py-pip/pip.pyz
does not exist, download it from https://bootstrap.pypa.io/pip/pip.pyz (the directory is determined by the XDG cache directory) - If the found interpreter is not within a virtual environment, a minimal one will be created in
.venv
next topyproject.toml
- Run
py ~/.cache/py-pip/pip.pyz
, passing along all arguments - In the background, check if
pip.pyz
is outdated, and update it if necessary