From: pypa/pip#9187 (comment)
could there be an easy option that forbides pip-21.2.1 to downgrade any already installed package (like specifying the existing packages version as a minimal constraint
>=
) ?
@stonebig if you still have your pip cache populated, there is a way to achieve it without spamming the pypi registry: you can use the output of pip freeze
and feed it to your pip command with an additional -r
(it can be used multiple times):
pip freeze | sed 's/==/>=/' >> ./constraints.txt
pip install <some-new-package> -r ./constraints.txt