Editable requirements don't get symlinked properly. #435

JivanAmara opened this Issue Jan 19, 2012 · 4 comments


None yet

4 participants


I'm running pip 1.0.2 on Ubuntu in a virtual environment. When using an editable requirement in a requirements file:
-e git+file:///path/to/repo@branch#egg=egg_name
the installation with 'pip install -r requirements' works mostly as expected, checking out the code to 'VENV/src/egg-name'.

The package doesn't show up in the python path though. There is a text file in site-packages 'egg-name.egg-link' which contains the path 'VENV/src/egg-name'. If I make a symlink to 'VENV/src/egg-name' in site-packages manually, all is well.

There is a stack overflow question addressing this issue as well:

jezdez commented Jan 19, 2012

Pip uses a feature of setuptools to handle the installation of those editable requirements, known for the -e (or --editable) in front of it. Behind the scenes pip will actually simply call python setup.py develop (more or less) which creates the *.egg-link file. On Python level it acts like a symlink which means no additional symlink is needed on the file system.

Try opening the virtualenv's Python command (VENV/bin/python) and import the module you wanted to install editable. What does youmodule.__file__ give you?

Here is a little more background about how this works: http://api.rst2a.com/1.0/rst2/html?uri=http://svn.python.org/projects/sandbox/trunk/setuptools/doc/formats.txt#egg-links

rh0dium commented Jan 19, 2012

Thanks so much for this detailed answer on how it's supposed to work. Really appreciated!

jezdez commented Jan 19, 2012

Gladly, I hope this works for you now.

@jezdez jezdez closed this Jan 19, 2012
carljm commented Jan 19, 2012

FWIW, a bit more detail: the .egg-link file is actually just a marker file; what causes the package to be importable is the entry that is added to easy-install.pth. pth files are a built-in feature of Python; see http://docs.python.org/library/site.html

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