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+https:[email protected]8b0bbf0c39322f5b761b05463685355b4f#egg=django_
-e hg+https:[email protected]0d3c97bc468ea8360260a6b#egg=django_registration
-e git:[email protected]f4ee3c96d4508fa12278c47c660c37#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