Python package install using pip to source doesn't create a symlink

Tag: virtualenv , pip Author: zhenuc Date: 2011-10-12

So I'm a convert with pip and virtualenv. One of the things I've found is that when I use a requirements.txt with contents which look like this the subsequent pip -E -r requirements.txt works as intended..


But when you start getting fancy with your requirements.txt by pulling source trees, the following behavior is seen. 1) It pull the source into "source" tree. (That's good) 2) It fails to create a symlink to this in the site-packages tree but rather create *.link (.ie django-debug-toolbar.egg-link )

-e git+[email protected]f#egg=django_
-e hg+[email protected]#egg=django_registration
-e git://[email protected]47c660c37#egg=django_registrati

The problem is that now I have to create the symlink to the source tree from the site-packages tree. To fix this I shift over to the site-packages tree and start creating symlinks back to the sources tree.

I'm sure there is a better way to do this - can someone please enlighten me??

Best Answer

You don't have to create a symlink at all, the so called *.egg-link files in the site-packages directory of the virtualenv will act as a symlink on Python (well, actually setuptools) level.

EDIT: I added a bit of background info here:


Do you know how that works? Is that an idiom of setuptools? Nevermind - your answer here ( provided all the necessary links! Awesome