pip install --upgrade --upgrade-strategy only-if-needed somepackage
If you only want to upgrade one specific package called somepackage, the command you should use in recent versions of pip is
pip install --upgrade --upgrade-strategy only-if-needed somepackage
This is very useful when you develop an application in Django that currently will only work with a specific version of Django (say Django=1.9.x) and want to upgrade some dependent package with a bug-fix/new feature and the upgraded package depends on Django (but it works with, say, any version of Django after 1.5).
The default behavior of pip install --upgrade django-some-package would be to upgrade Django to the latest version available which could otherwise break your application, though with the --upgrade-strategy only-if-needed dependent packages will now only be upgraded as necessary.
- Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии