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

Already on GitHub? Sign in to your account

Assertion error attempting to uninstall package after virtualenv relocation #640

kylegibson opened this Issue Aug 16, 2012 · 5 comments


None yet
5 participants

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

(testenv)<socrates> ~
> pip uninstall pyyaml
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
  File "/home/kyle/testenv/lib/python2.6/site-packages/pip-1.1-py2.6.egg/pip/req.py", line 862, in uninstall
  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

kylegibson added a commit to kylegibson/pip that referenced this issue Aug 16, 2012


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 commented Aug 21, 2012

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

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

shadowmint commented Feb 24, 2017 edited

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 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 Mar 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment