Issue #119 new

distribute reinstalls packages from system site-packages when using virtualenv

Ralf Schmitt
created an issue

I have a fresh install of python 2.6.4 in /opt/py26/ installed as root. As root I now also install the lockfile module with

$ /opt/py26/bin/python install

As user I create a virtualenv with

/opt/py26/bin/python ~/py26 --distribute

Now I run

~/py26/bin/easy_install lockfile

which tries to download the lockfile module and installs it in my virtualenv. If I remove the --distribute option, setuptools recognizes the old installation of the lockfile module in /opt/py26/... and does not reinstall it.

Comments (7)

  1. Ralf Schmitt reporter

    The following patch fixed it for me:

    diff --git a/setuptools/command/ b/setuptools/command/
    old mode 100644
    new mode 100755
    index fb8cd74..2c7df92
    --- a/setuptools/command/
    +++ b/setuptools/command/
    @@ -193,7 +193,7 @@ class easy_install(Command):
                 hosts = ['*']
             if self.package_index is None:
                 self.package_index = self.create_index(
    -                self.index_url, search_path = self.shadow_path, hosts=hosts,
    +                self.index_url, search_path = self.shadow_path+sys.path, hosts=hosts,
             self.local_index = Environment(self.shadow_path+sys.path)
  2. Ralf Schmitt reporter

    well, the lockfile module is already installed. why should it be reinstalled? it also doesn't reinstall it if it's installed inside the virtualenv.

  3. Lennart Regebro

    It sounds like a good way to test installations, but I guess that's only relevant if it is a newer version. Adding all of sys.path sounds like a big addition though. This probably needs to be discussed on distutils-sig.

  4. Log in to comment