Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Editable requirements don't get symlinked properly. #435

Closed
JivanAmara opened this Issue · 4 comments

4 participants

@JivanAmara

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:
http://stackoverflow.com/questions/7926060/python-package-install-using-pip-to-source-doesnt-create-a-symlink

@jezdez
Owner

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

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

@jezdez
Owner

Gladly, I hope this works for you now.

@jezdez jezdez closed this
@carljm
Owner

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
Something went wrong with that request. Please try again.