`pip install -U` upgrades already satisfied dependencies
See original GitHub issueIf I pip install -U foo
, I would expect that the latest version of foo
will be installed, and foo
’s dependencies will only be reinstalled if they’re not already satisfied. But in fact the dependencies all get reinstalled even if I already have identical versions installed:
$ pip install -U django-supervisor
Downloading/unpacking django-supervisor
Downloading django-supervisor-0.2.0.tar.gz
Running setup.py egg_info for package django-supervisor
Downloading/unpacking supervisor (from django-supervisor)
Downloading supervisor-3.0a10.tar.gz (438Kb): 438Kb downloaded
Running setup.py egg_info for package supervisor
no previously-included directories found matching 'docs/*.pyc'
no previously-included directories found matching 'docs/.build'
Downloading/unpacking meld3>=0.6.5 (from supervisor->django-supervisor)
Downloading meld3-0.6.7.tar.gz
Running setup.py egg_info for package meld3
Installing collected packages: django-supervisor, supervisor, meld3
Found existing installation: django-supervisor 0.1.1
Uninstalling django-supervisor:
Successfully uninstalled django-supervisor
Running setup.py install for django-supervisor
Found existing installation: supervisor 3.0a10
Uninstalling supervisor:
Successfully uninstalled supervisor
Running setup.py install for supervisor
no previously-included directories found matching 'docs/*.pyc'
no previously-included directories found matching 'docs/.build'
Skipping installation of /usr/local/ejucovy/django/lib/python2.6/site-packages/supervisor/__init__.py (namespace package)
Installing /usr/local/ejucovy/django/lib/python2.6/site-packages/supervisor-3.0a10-py2.6-nspkg.pth
Installing echo_supervisord_conf script to /usr/local/ejucovy/django/bin
Installing pidproxy script to /usr/local/ejucovy/django/bin
Installing supervisorctl script to /usr/local/ejucovy/django/bin
Installing supervisord script to /usr/local/ejucovy/django/bin
Found existing installation: meld3 0.6.7
Uninstalling meld3:
Successfully uninstalled meld3
Running setup.py install for meld3
Successfully installed django-supervisor supervisor meld3
Cleaning up...
My “existing installations” of supervisor-3.0a10
and meld3-0.6.7
are both “successfully uninstalled”, and then identical versions are installed.
Issue Analytics
- State:
- Created 12 years ago
- Reactions:4
- Comments:23 (13 by maintainers)
Top Results From Across the Web
Install pip package when already satisfied by distro package
I have something like the following in my Dockerfile: ADD api/requirements.txt /app/ # Install apt and pip packages RUN set -ex ...
Read more >pip install - pip documentation v22.3.1
“eager” - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s).
Read more >Using Python's pip to Manage Your Projects' Dependencies
Note: On some Linux (Unix) systems like Ubuntu, pip comes in a separate package called python3-pip , which you need to install with...
Read more >Possible to guard installed packages from upgrade when ...
Imagine I have two packages foo and bar where foo is a dependency of bar. foo is already installed and I now want...
Read more >Upgrading Packages using PIP - The Sum Of It
If you've never used pip to install a package you love how simple it is, ... 11.8MB 1.4MB/s Requirement already satisfied, skipping upgrade: ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think it’s a duplicate of #49. I read #49 as saying that
install -U foo
shouldn’t reinstallfoo
itself if it’s already at the latest version – which is different from whether or not it should reinstallfoo
’s already-satisfied dependencies.This distinction matters for hard-to-build libraries which have frequent releases but fairly stable APIs – for the most part, one installation is good enough – I’d only want to reinstall it if my dependencies start to use newer features from those nested dependencies (i.e. if the requirement is no longer satisfied) – for example:
foo 0.1
depends onlxml>=2.3.0
foo 0.2
is released, and depends onlxml>=2.3.0
(same dependency)lxml 2.4.0
is releasedIf I’ve already installed
foo 0.1
andlxml 2.3.0
, and Ipip install -U foo
, I wouldn’t want it to installlxml 2.4.0
. It should only installlxml 2.4.0
whenfoo
starts to depend onlxml>=2.4.0
.easy_install does not have the same behavior. easy_install will not re-install dependencies if they are already met.
this isn’t a feature or behavior, this is a bug.
this is also really annoying – testing PIP distribution for a framework’s package , or updating a single framework add-on, means needing to re-install the entire framework and all of it’s dependencies. these unnecessary downloads and installs are a waste of time and resources.