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

Assertion error attempting to uninstall package after virtualenv relocation #640

Closed
kylegibson opened this issue Aug 16, 2012 · 5 comments
Closed
Labels
auto-locked Outdated issues that have been locked by automation type: bug A confirmed bug or unintended behavior

Comments

@kylegibson
Copy link

Pip fails because the egg-link contains a relative path instead of an absolute path.

(testenv)<socrates> ~
> pip uninstall pyyaml
Exception:
Traceback (most recent call last):
  File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/basecommand.py", line 104, in main
    status = self.run(options, args)
  File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/commands/uninstall.py", line 41, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/req.py", line 862, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/req.py", line 461, in uninstall
    assert (link_pointer == dist.location), 'Egg-link %s does not match installed location of %s (at %s)' % (link_pointer, self.name, dist.location)
AssertionError: Egg-link ../../../src/yaml/lib does not match installed location of pyyaml (at /home/kyle/testenv/src/yaml/lib)
(testenv)<socrates> ~ 
[2]> cat /home/kyle/testenv/lib/python2.6/site-packages/PyYAML.egg-link
../../../src/yaml/lib%                                                  
@qwcode
Copy link
Contributor

qwcode commented Aug 21, 2012

do you recall how you did your develop/editable install of pyyaml exactly?
it's a pure distutils distribution, so I guess not directly by using python setup.py develop. distutils doesn't support develop. I guess by some form of pip install -e <pyyaml path>?

@qwcode
Copy link
Contributor

qwcode commented Aug 21, 2012

oh ok, just noticed in your title, you did a virtualenv relocation.

@kylegibson
Copy link
Author

pyyaml was installed with pip install -e
And yes, I did a virutalenv --relocatable

@shadowmint
Copy link

shadowmint commented Feb 24, 2017

fwiw, I encountered this issue and found that running ./bin/pip install -e ... failed, but actually activating the virtualenv; source ./bin/activate; pip -e ... worked as a work around.

I was under the impression you could use pip from a virtualenv without using activate, but it seems like once you apply virtualenv --relocatable this is no longer true.

virtualenv .
./bin/pip install -e ~/foo.bar <-- works

virtualenv --relocatable .
./bin/pip install -e ~/foo.bar --upgrade  <--- fails
source ./bin/activate; pip install -e ~/foo.bar --upgrade <--- works

@dstufft
Copy link
Member

dstufft commented Mar 31, 2017

This is going to be a bug with virtualenv --reloctable and not pip... unfortunately --relocatable is a giant hack so this is likely going to persist :(. Closigng this though and this should be reopened on the virtualenv tracker.

@dstufft dstufft closed this as completed Mar 31, 2017
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
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 type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants