Migrates all PyPI packages installed using pipx
to a new version of Python.
Users of Python software installed via pipx
.
python3.n
(n = new, whichever version you want to migrate to)python-pip
version (or the distribution package)Take note of all installed pipx
packages, then uninstall them all.
pipx list
pipx uninstall-all
Uninstall pipx
with the old pip
.
python3.o -m pip uninstall pipx
Here I also deleted the ~/.local/pipx
directory to ensure a clean reinstall. pipx
will recreate it, anyway.
rm -rf ~/.local/pipx
With pip
in the new Python version, reinstall pipx
.
python3.n -m pip install pipx
Reinstall all PyPI packages with pipx
from the list pulled earlier. Example with Ansible.
pipx install ansible
pipx inject ansible ansible-lint
Optionally, check if there are links from the pipx
venv binaries for the installed packages to a path in $PATH
(in my case, ~/.local/bin
). Example with Ansible.
for i in ~/.local/pipx/venvs/ansible/bin/ansible*; do
ln -s $i .local/bin/${i##*/};
done