question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`pip install -U` upgrades already satisfied dependencies

See original GitHub issue

If 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:closed
  • Created 12 years ago
  • Reactions:4
  • Comments:23 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
ejucovycommented, Jun 9, 2011

I don’t think it’s a duplicate of #49. I read #49 as saying that install -U foo shouldn’t reinstall foo itself if it’s already at the latest version – which is different from whether or not it should reinstall foo’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 on lxml>=2.3.0
  • foo 0.2 is released, and depends on lxml>=2.3.0 (same dependency)
  • lxml 2.4.0 is released

If I’ve already installed foo 0.1 and lxml 2.3.0, and I pip install -U foo, I wouldn’t want it to install lxml 2.4.0. It should only install lxml 2.4.0 when foo starts to depend on lxml>=2.4.0.

2reactions
jvanascocommented, May 23, 2012

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found