Issues

Issue #196 resolved

Can't install 4.1

Diogo Baeder
created an issue

Hi,

I can't install version 4.1 (actually, 4.1.1) in my Ubuntu box, either with pip or easy_install. This is the error I get in both methods, when trying to install:

"setup.py: error: no such option: --dist-dir"

Comments (13)

  1. Doug Hellmann repo owner

    That is a very old version of setuptools. It looks like something in the new packaging for virtualenvwrapper is using a feature of the newer setuptools library.

  2. Diogo Baeder reporter

    So, I've updated distribute, here, hoping it might be enough (since the current Ubuntu stable version includes a "very old" version of setuptools, and I won't be able to change that). This is what I'm having:

     ~ ▶ $ ▶pip show distribute
    ---
    Name: distribute
    Version: 0.7.3
    Location: /usr/local/lib/python2.7/dist-packages
    Requires: setuptools
     ~ ▶ $ ▶easy_install --version
    setuptools 0.9.7
     ~ ▶ $ ▶sudo pip install -U virtualenvwrapper
    Downloading/unpacking virtualenvwrapper from https://pypi.python.org/packages/source/v/virtualenvwrapper/virtualenvwrapper-4.1.1.tar.gz#md5=f18f2c612b936583a8ec0f7114b6637e
      Downloading virtualenvwrapper-4.1.1.tar.gz (81kB): 81kB downloaded
      Running setup.py egg_info for package virtualenvwrapper
        Usage: setup.py [options]
    
        setup.py: error: no such option: --dist-dir
        Traceback (most recent call last):
          File "<string>", line 16, in <module>
          File "/tmp/pip-build-root/virtualenvwrapper/setup.py", line 7, in <module>
            pbr=True,
          File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
            _setup_distribution = dist = klass(attrs)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 265, in __init__
            self.fetch_build_eggs(attrs.pop('setup_requires'))
          File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 289, in fetch_build_eggs
            parse_requirements(requires), installer=self.fetch_build_egg
          File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 618, in resolve
            dist = best[req.key] = env.best_match(req, self, installer)
          File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 862, in best_match
            return self.obtain(req, installer) # try and download/install
          File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 874, in obtain
            return installer(requirement)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 339, in fetch_build_egg
            return cmd.easy_install(req)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 623, in easy_install
            return self.install_item(spec, dist.location, tmpdir, deps)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 653, in install_item
            dists = self.install_eggs(spec, download, tmpdir)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 849, in install_eggs
            return self.build_and_install(setup_script, setup_base)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
            self.run_setup(setup_script, setup_base, args)
          File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1118, in run_setup
            raise DistutilsError("Setup script exited with %s" % (v.args[0],))
        distutils.errors.DistutilsError: Setup script exited with 2
        Complete output from command python setup.py egg_info:
        Usage: setup.py [options]
    
    
    
    setup.py: error: no such option: --dist-dir
    
    Traceback (most recent call last):
    
      File "<string>", line 16, in <module>
    
      File "/tmp/pip-build-root/virtualenvwrapper/setup.py", line 7, in <module>
    
        pbr=True,
    
      File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
    
        _setup_distribution = dist = klass(attrs)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 265, in __init__
    
        self.fetch_build_eggs(attrs.pop('setup_requires'))
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 289, in fetch_build_eggs
    
        parse_requirements(requires), installer=self.fetch_build_egg
    
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 618, in resolve
    
        dist = best[req.key] = env.best_match(req, self, installer)
    
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 862, in best_match
    
        return self.obtain(req, installer) # try and download/install
    
      File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line 874, in obtain
    
        return installer(requirement)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/dist.py", line 339, in fetch_build_egg
    
        return cmd.easy_install(req)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 623, in easy_install
    
        return self.install_item(spec, dist.location, tmpdir, deps)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 653, in install_item
    
        dists = self.install_eggs(spec, download, tmpdir)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 849, in install_eggs
    
        return self.build_and_install(setup_script, setup_base)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1130, in build_and_install
    
        self.run_setup(setup_script, setup_base, args)
    
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1118, in run_setup
    
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    
    distutils.errors.DistutilsError: Setup script exited with 2
    
    ----------------------------------------
    Cleaning up...
    Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/virtualenvwrapper
    Storing complete log in /home/diogobaeder/.pip/pip.log
    
  3. Diogo Baeder reporter

    Yes, I know that they got merged (the own python-setuptools package, in Debian and Ubuntu, is just distribute with a different name). But it doesn't seem to me that a solution like "just upgrade" is a good solution, considering this is a very important package for both distributions and that other packages might depend on them.

    Take other distributions, for example: in CentOS 6.4, the setuptools version is 0.6.10 (http://centos.arcticnetwork.ca/6.4/os/x86_64/Packages/). In Fedora 19, it's 0.6.36 (https://apps.fedoraproject.org/packages/python-setuptools). Wouldn't it make sense to just support all of these versions, since they're the latest stable ones, instead of telling everyone to "just upgrade setuptools"? Food for thought. :-)

  4. Diogo Baeder reporter

    OK, guys, I've tried to upgrade setuptools, but somehow Ubuntu keeps its original setuptools version over the one I tried to install via pip:

     ~ ▶ $ ▶easy_install --version
    setuptools 0.9.7
     ~ ▶ $ ▶pip show setuptools
    ---
    Name: setuptools
    Version: 0.6c11
    Location: /usr/local/lib/python2.7/dist-packages
    Requires: 
    

    That being said, I'm unable to use virtualenvwrapper anymore.

    Can someone figure out a way out of this, please? Let me know if you need more information, for the time being I have a box with broken dependencies. :-(

  5. Leonardo Santagada

    One idea would be to uninstall setuptools with pip (which will remove only the user installed version I think) and then try to install/run virtualenvwrapper inside a virtualenv with setuptools 0.9. If that works at least we know it is just a problem with setuptools which can be solved either by patching virtualenvwrapper or declaring a dependency on a newer setuptools.

  6. Diogo Baeder reporter

    So, I tried installing setuptools in a virtualenv (without uninstalling it globally), and then installing virtualenvwrapper. This worked fine, as it could use the newer setuptools features. This doesn't fix the issue, however, as I need to run virtualenvwrapper globally to, well, create virtual environments.

    Considering Ubuntu and Debian are among the most used Linux distributions, I completely disagree with making virtualenvwrapper depend on a newer setuptools, as this will require all these users to deal with the problem of having a not-so-up-to-date setuptools in they package managers. Instead, I'd recomend you to just make it compatible with previous setuptools, if possible.

    However, this is not my project, and I'm not a stakeholder for it, so do as you see fit. I'll just keep using the old virtualenvwrapper versions as long as they exist. :-)

  7. Doug Hellmann repo owner

    The issue isn't in virtualenvwrapper itself, it's in the packaging library pbr. If updating setuptools fixes the problem, and no new release of virtualenvwrapper is needed, then I think it's fair to call it resolved.

  8. Log in to comment