Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Egg-link {path} does not match installed location of {package} #4466

Closed
mrmachine opened this issue May 8, 2017 · 4 comments
Labels
C: user scheme Handling of packages in user-specific directories type: support User Support

Comments

@mrmachine
Copy link

  • Pip version: 9.0.0, 9.0.1
  • Python version: 2.7.13
  • Operating system: Ubuntu Xenial

Description:

I have installed an editable package into /opt/django-dynamic-fixture (PIP_SRC=/opt) when building a Docker image. When I run a container with this image, we set PYTHONUSERBASE=$PROJECT_DIR/var/src so we can do pip install --user ... and:

  1. Make use of existing packages already installed in the Docker image
  2. Ignore (instead of uninstalling) conflicting packages already installed (first rule listed here: https://pip.pypa.io/en/stable/user_guide/#user-installs)

The reason 2. above is important is the existing packages are in an ephemeral and possibly read only file system when the Docker container runs.

This works fine with pip<9.0.0 but no longer works with 9.0.0 and 9.0.1.

Here's the error:

bash-4.3# pip install -e 'git+https://github.com/ixc/django-dynamic-fixture.git@caeb3427399edd3b0d589516993c7da55e0de560#egg=django-dynamic-fixture'
Obtaining django-dynamic-fixture from git+https://github.com/ixc/django-dynamic-fixture.git@caeb3427399edd3b0d589516993c7da55e0de560#egg=django-dynamic-fixture
  Skipping because already up-to-date.
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from django-dynamic-fixture)
Installing collected packages: django-dynamic-fixture
  Found existing installation: django-dynamic-fixture 1.9.0
Exception:
Traceback (most recent call last):
  File "/opt/django-icekit/project_template/var/docker-pythonuserbase/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/opt/django-icekit/project_template/var/docker-pythonuserbase/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/opt/django-icekit/project_template/var/docker-pythonuserbase/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/opt/django-icekit/project_template/var/docker-pythonuserbase/lib/python2.7/site-packages/pip/req/req_install.py", line 701, in uninstall
    '(at %s)' % (link_pointer, self.name, dist.location)
AssertionError: Egg-link /opt/django-icekit/project_template/var/src/django-dynamic-fixture does not match installed location of django-dynamic-fixture (at /opt/django-dynamic-fixture)
bash-4.3# 

This seems to be a regression, as the docs linked above still indicate existing packages should be ignored (not uninstalled).

@MartinThoma
Copy link

https://stackoverflow.com/a/48972085/562769

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label May 11, 2018
@MartinThoma
Copy link

I think this issue should be closed.

@xavfernandez xavfernandez added the type: support User Support label Jun 10, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Jun 10, 2019
@xavfernandez xavfernandez added the C: user scheme Handling of packages in user-specific directories label Jun 10, 2019
@DevMMI
Copy link

DevMMI commented Sep 29, 2020

Use pip install -e <package_dir> -I to ignore other installed packages and overwrite them

@uranusjr
Copy link
Member

Since -I (i.e. --ignore-installed) does not attempt to uninstall previously-installed dependencies, it is better to use --no-deps to only fix the broken editable.

The command I recommend is

pip install --no-deps -I -e <package>

I agree with pip’s current approach to be safe and not aggressively remove the broken link. This is ultimately an environment problem that is best handled by the user. The error message has room for improvement, but that’s better filed as a separate enhancement issue IMO.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: user scheme Handling of packages in user-specific directories type: support User Support
Projects
None yet
Development

No branches or pull requests

6 participants