3

I would like to pin specific package version installed using pipx and prevent its upgrade.

E.g. I have installed package:

$ pipx install somepackage==2.0.0

Then after upgrade it will be updated to the latest version:

$ pipx upgrade-all

Is it possible to upgrade only packages installed without specified version?

1 Answer 1

4

You pin a package with pipx pin package-name.

Example: Installing csvkit version 2.0.0. The most recent version is 2.0.1, so I want to pin it to 2.0.0 to prevent it from upgrading.

$ pipx install csvkit==2.0.0
  installed package csvkit 2.0.0, installed using Python 3.12.3
  These apps are now globally available
    - csvclean
    - csvcut
    - csvformat
    - csvgrep
    - csvjoin
    - csvjson
    - csvlook
    - csvpy
    - csvsort
    - csvsql
    - csvstack
    - csvstat
    - in2csv
    - sql2csv
    Note: '/home/myself/.local/bin' is not on your PATH environment variable. These apps will not be
    globally accessible until your PATH is updated. Run `pipx ensurepath` to automatically add it, or
    manually modify your PATH in your shell's config file (e.g. ~/.bashrc).
done!  🌟
$ pipx pin csvkit
$ pipx upgrade-all
Not upgrading pinned package csvkit. Run `pipx unpin csvkit` to unpin it.
2
  • pin/unpin command was added in pipx v1.6.0. Found another solution in change request discussion - --skip option: $ pipx upgrade-all --skip package-name.
    – anlar
    Commented Aug 7 at 5:07
  • @anlar If it's a single package and if you remember it at the time of upgrade, then that might be an option.
    – Kusalananda
    Commented Aug 7 at 6:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .