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 […] does not match installed location when symlinks added to venv path #6900

Closed
schlichtanders opened this issue Aug 20, 2019 · 5 comments
Labels
auto-locked Outdated issues that have been locked by automation C: editable Editable installations type: support User Support

Comments

@schlichtanders
Copy link

pip-19.2.2

I am opening a new ticket, because I cannot add remarks to any of the following related old issues (#640, #640)

To repeat, the problem is that pip install --upgrade ... or pip uninstall ... have a check for the path in *.egg-link files which does not handle relative files.

To add, setuptools explains that relative egg-files are valid https://setuptools.readthedocs.io/en/latest/formats.html#egg-links

As of setuptools 0.6c6, the path may be specified as a platform-independent (i.e. /-separated) 
relative path from the directory containing the .egg-link file

Here a recent error which I still get after updating pip to pip-19.2.2

ERROR: Exception:
Traceback (most recent call last):
  File "/home/NQ10014537/tmp/pdi_products/virtualenv/lib64/python3.6/site-packages/pip/_internal/cli/base_command.py", line 188, in main
    status = self.run(options, args)
  File "/home/NQ10014537/tmp/pdi_products/virtualenv/lib64/python3.6/site-packages/pip/_internal/commands/install.py", line 407, in run
    use_user_site=options.use_user_site,
  File "/home/NQ10014537/tmp/pdi_products/virtualenv/lib64/python3.6/site-packages/pip/_internal/req/__init__.py", line 51, in install_given_reqs
    auto_confirm=True
  File "/home/NQ10014537/tmp/pdi_products/virtualenv/lib64/python3.6/site-packages/pip/_internal/req/req_install.py", line 830, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "/home/NQ10014537/tmp/pdi_products/virtualenv/lib64/python3.6/site-packages/pip/_internal/req/req_uninstall.py", line 538, in from_dist
    '(at %s)' % (link_pointer, dist.project_name, dist.location)
AssertionError: Egg-link ../../../src/MYPACKAGENAME does not match installed location of MYPACKAGENAME (at /absolute/path/to/MYPACKAGENAME)
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Aug 20, 2019
@pradyunsg
Copy link
Member

Is this with a relocatable virtualenv?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label Aug 21, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Aug 21, 2019
@schlichtanders
Copy link
Author

this is with python -m venv plus manual rewriting of absolute paths to relative ones

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Sep 25, 2019
@chrahunt chrahunt added C: editable Editable installations type: support User Support labels Oct 13, 2019
@pradyunsg
Copy link
Member

Could you provide a set of reproducible steps that expose this issue? Also, could you also state which check in the un-installation logic is the check-that-does-not-handle-relative-files is?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label Feb 5, 2020
@coyoteecd
Copy link

For what is worth, I got the same problem on Windows after running pip install -e for an open source package (cfn-python-lint) with the code checked out in a mapped/subst-ed drive.

I have drive K: subst-ed to C:\Code, and I installed with pip install -e from K:\sws\cfn-python-lint.
When I try to uninstall, I get:

ERROR: Exception:
Traceback (most recent call last):
  File "c:\program files (x86)\python38-32\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "c:\program files (x86)\python38-32\lib\site-packages\pip\_internal\commands\uninstall.py", line 74, in run
    uninstall_pathset = req.uninstall(
  File "c:\program files (x86)\python38-32\lib\site-packages\pip\_internal\req\req_install.py", line 830, in uninstall
    uninstalled_pathset = UninstallPathSet.from_dist(dist)
  File "c:\program files (x86)\python38-32\lib\site-packages\pip\_internal\req\req_uninstall.py", line 536, in from_dist
    assert (link_pointer == dist.location), (
AssertionError: Egg-link k:\sws\cfn-python-lint\src does not match installed location of cfn-lint (at c:\code\sws\cfn-python-lint\src)

@no-response
Copy link

no-response bot commented Feb 20, 2020

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Feb 20, 2020
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Mar 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 21, 2020
@pradyunsg pradyunsg removed the S: awaiting response Waiting for a response/more information label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: editable Editable installations type: support User Support
Projects
None yet
Development

No branches or pull requests

4 participants