pip icon indicating copy to clipboard operation
pip copied to clipboard

pip (7.0.0) wheel command with latest setuptools error message lies

Open gcarothers opened this issue 11 years ago • 14 comments

pip install --upgrade 'pip>=1.4.1'
Requirement already up-to-date: pip>=1.4.1 in /home/lex/lib/python2.7/site-packages
pip install --upgrade 'setuptools>=0.8'
Requirement already up-to-date: setuptools>=0.8 in /home/lex/lib/python2.7/site-packages
pip install wheel
Requirement already satisfied (use --upgrade to upgrade): wheel in /home/lex/lib/python2.7/site-packages
pip wheel -w wheelhouse -f wheelhouse -r requirements.txt
ERROR: 'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptools

Down grading back to pip==6.1.1 and setuptools==15.2 works perfectly fine.

gcarothers avatar May 22 '15 20:05 gcarothers

What OS and version of Python? I can't reproduce this locally so there must be something else happening here.

dstufft avatar May 22 '15 20:05 dstufft

Ok, so I see two problems here:

  • The wheel created by this is for the pip-test project, but you're specifying an #egg=fake name to tell it that it's actually fake. This is what's causing the error when It's trying to install it, however this case shouldn't be able to be reached because...
  • We're building a wheel for something that comes from VCS, we should only be doing that if it comes from a real package and not from VCSs.

dstufft avatar May 22 '15 20:05 dstufft

Adding @rbtcollins because he wrote this feature and might have a better idea of why it's happening. I'm going to poke at it now though.

dstufft avatar May 22 '15 20:05 dstufft

OS: Debian 7 (wheezy) Python: Python 2.7.3 ... ah, this is inside a virtualenv

gcarothers avatar May 22 '15 20:05 gcarothers

What happens if you open up python and try to do import pkg_resources? If that works, does it have an attribute named DistInfoDistribution.

dstufft avatar May 22 '15 22:05 dstufft

Very confused now, after downgrading and upgrading back to current pip and setuptools works fine.

gcarothers avatar May 22 '15 22:05 gcarothers

ERROR: 'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptools
make: *** [install-wheelhouse] Error 1
(test)gavin@perms:/home/lex/src/deus_lex$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> pkg_resources.DistInfoDistribution
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'DistInfoDistribution'
>>> 

Virtualenv details:

/usr/bin/virtualenv --version
1.7.1.2

virtualenv creation pip

pip 1.1 from /home/gavin/test2/lib/python2.7/site-packages/pip-1.1-py2.7.egg (python 2.7)

gcarothers avatar May 22 '15 22:05 gcarothers

So the issue seems to be a lingering distribute-0.6.24 that isn't being uninstalled any more. Prior versions of pip and setuptools correctly removed distribute-0.6.24 but the current versions do not.

gcarothers avatar May 22 '15 22:05 gcarothers

@dstufft removed the shims for that AIUI - perhaps we were too optimistic about the death of old things.

rbtcollins avatar May 23 '15 04:05 rbtcollins

wheezy is supported thru 2018. it would be hard to maintain the distribute-to-setuptools hacks for that long.

I think the simplest thing is to do a "source install" of the latest virtualenv (see https://virtualenv.pypa.io/en/latest/installation.html#installation), and go from there. don't try to bootstrap from the system version of virtualenv. that way, you'd have the latest pip and setuptools in your virtualenv, and no distribute to upgrade.

another possible route would be to use debian backports, but it seems nobody is maintaining backports for pip/setuptools/virtualenv (at least for wheezy)

qwcode avatar May 25 '15 19:05 qwcode

The other possible route getting a newer virtualenv into wheezy backports runs into a rather annoying issue. Turns out the current jessie/sid virtualenv package does not in fact use virtualenv_support and instead is patched to use /usr/share/python-wheels/ this makes it very hard to create a backported virtualenv without replacing lots of machinery in wheezy.

If there isn't support for maintaining the distribute-to-setuptools hacks it seems at least worth while to have an error message that gives someone an idea of what's going on.

gcarothers avatar May 26 '15 14:05 gcarothers

I agree; Personally I think we should reinstate it, but warning would be better than nothing. I've seen what 3 distribute related new bugs in the last couple weeks?

rbtcollins avatar Jun 09 '15 22:06 rbtcollins

For reference wheezy is NOT fully supported till 2018 just till February 2016. After that it will no longer get updates from the Debian security team. Volunteer LTS support is planned.

gcarothers avatar Jun 10 '15 22:06 gcarothers

Closing this as it seems to require an ancient version of distribute and Debian to trigger.

dstufft avatar Mar 22 '17 21:03 dstufft