Error in pip instructions?

Re: Certbot Instructions | Certbot

Under the last section, for monthly upgrades, the command provided is:

sudo /opt/certbot/bin/pip install --upgrade

I think that should be

sudo /opt/certbot/bin/pip install --upgrade certbot
2 Likes

I can't test it myself right now, but doesn't the pip install --upgrade without a specific package name just upgrade all packages in the virtual environment? Which is probably the desired behaviour I'd say.

4 Likes

I think this is probably an error. The original PR for the instructions listed package names to be upgraded. I've noted this in an existing issue.

5 Likes

I can't test it myself right now, but doesn't the pip install --upgrade without a specific package name just upgrade all packages in the virtual environment?

Ah I wasn't aware of this, I'm not very adept with the python environment by any means. But when I did try the command without a package, it failed for me IIRC. Could be a thing with older versions of python.

2 Likes

No, it emits an error that you must list at least one item to install.

A complete library upgrade in Python is never a desired behavior, as programs are often pinned to certain package versions. pip is unaware of the programs a virtualenv was established for, and can not cross-check against the requirements.txt files for those applications - it only has access to the local/global package libraries.

2 Likes

Hm, I looked at a certain man page for pip which I can't find any longer on this PC where it wasn't that clear what arguments pip install --upgrade required exactly. But looking at the pip install documentation it's clear that pip install always requires some kind of argument such as a package.

Thus: I stand corrected :slight_smile:

3 Likes

That is not correct. pip install --upgrade will automatically update all the dependency packages when the update is required.

For example: if you upgrade certbot and the new version requires acme>=1.25.0 and 1.27.0 is the most current version, pip will upgrade acme to 1.27.0 if your installed version is under 1.25.0. However, if your installed version is 1.25.0 or 1.26.0, pip will not upgrade to 1.27.0 because that upgrade is not required.

This is default behavior of pip and controlled by the upgrade-strategy option, which is set to "only-if-needed". If you want to always upgrade dependencies, even when the upgrade is not required, you can pass in a commandline option to switch to the "eager" upgrade strategy. This is generally not recommended, as it increases deployment/upgrade time and has been the source of many compatibility issues over the years.

See :

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.