AssertionError: Egg-link […] does not match installed location when symlinks added to venv path
See original GitHub issue- Pip version: 8.1.2
- Python version: 2.7.11
- Operating System: ArchLinux
Description:
I have a virtualenv, and then move it somewhere with a symlink from the old path to the new path. pip uninstall then fails with Egg-links.
What I’ve run:
gsnedders@vanveen:~/test$ mkdir foo
gsnedders@vanveen:~/test$ cd foo
gsnedders@vanveen:~/test/foo$ virtualenv -p python2 py2-env
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/gsnedders/test/foo/py2-env/bin/python2
Also creating executable in /home/gsnedders/test/foo/py2-env/bin/python
Installing setuptools, pip, wheel...done.
gsnedders@vanveen:~/test/foo$ source py2-env/bin/activate
(py2-env) gsnedders@vanveen:~/test/foo$ pip install -e html5lib
html5lib should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
(py2-env) gsnedders@vanveen:~/test/foo$ pip install -e git+https://github.com/html5lib/html5lib-python.git
--editable=git+https://github.com/html5lib/html5lib-python.git is not the right format; it must have #egg=Package
(py2-env) gsnedders@vanveen:~/test/foo$ pip install -e git+https://github.com/html5lib/html5lib-python.git#egg=html5lib
Obtaining html5lib from git+https://github.com/html5lib/html5lib-python.git#egg=html5lib
Cloning https://github.com/html5lib/html5lib-python.git to ./py2-env/src/html5lib
Collecting six (from html5lib)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting webencodings (from html5lib)
Requirement already satisfied (use --upgrade to upgrade): setuptools>=18.5 in ./py2-env/lib/python2.7/site-packages (from html5lib)
Installing collected packages: six, webencodings, html5lib
Running setup.py develop for html5lib
Successfully installed html5lib six-1.10.0 webencodings-0.5
(py2-env) gsnedders@vanveen:~/test/foo$ cd ..
(py2-env) gsnedders@vanveen:~/test$ mv foo bar
(py2-env) gsnedders@vanveen:~/test$ ln -s bar foo
(py2-env) gsnedders@vanveen:~/test$ cd foo
(py2-env) gsnedders@vanveen:~/test/foo$ pip uninstall html5lib
Exception:
Traceback (most recent call last):
File "/home/gsnedders/test/foo/py2-env/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/gsnedders/test/foo/py2-env/lib/python2.7/site-packages/pip/commands/uninstall.py", line 76, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/home/gsnedders/test/foo/py2-env/lib/python2.7/site-packages/pip/req/req_set.py", line 336, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/home/gsnedders/test/foo/py2-env/lib/python2.7/site-packages/pip/req/req_install.py", line 687, in uninstall
'(at %s)' % (link_pointer, self.name, dist.location)
AssertionError: Egg-link /home/gsnedders/test/foo/py2-env/src/html5lib does not match installed location of html5lib (at /home/gsnedders/test/bar/py2-env/src/html5lib)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Egg-link .. does not match installed location of ReviewBoard ...
I believe this was caused by me installing a package at an additional location using the same virtualenv. How can I fix this...
Read more >I'm in Python purgatory - Linux Mint Forums
The AssertionError: Egg-link /dev/shm/protonvpn-cli-ng does not match installed location of protonvpn-cli (at ...
Read more >Changelog - pip documentation v22.3.1
Suppress location mismatch warnings when pip is invoked from a Python source tree, so ensurepip does not emit warnings on CPython make install...
Read more >venv does not create lib64 directory and appropriate symlinks
Creating a new venv on a multilib system does not install an appropriate link from lib to lib64 or the other way around....
Read more >pip Changelog - pyup.io
Add ``pip inspect`` command to obtain the list of installed distributions ... Suppress location mismatch warnings when pip is invoked from a Python...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have this issue as well on Windows 10 with Anaconda. I don’t remember my exact steps but I did
pip install .
andpip install -e .
in a directory containing asetup.py
for a local project. This wasn’t inside a virtualenv. I can now neitheruninstall
nor--upgrade install
either and get the same above error.I don’t think that this bug should have being closed as it seems to be easy to reproduce and apparently without a permanent workaround that you can apply to the build/test tools (like
tox.ini
).Here is how I reproduced it:
foo
package was installed from system and pip fails to remove/replace it because of already existingfoo.egg-link
file that contains something similar to../../../../..
.This does not happen if you didn’t install the
foo
package on the system. Still, pip fails to remove the.egg-link
.Example:
Update : found ugly workaround
It seems that I was able to find a way to avoid triggering this bug by adding two lines before the one installing the package in develop mode inside tox.ini: