On Windows, I was using pip 7.0.1 to install some eggs, notably zc.recipe.egg
which is part of buildout.
Since I upgraded virtualenv to version 13.1.0, which comes with a local pip wheel and thus installs pip 7.1.0, when I run pip install zc.recipe.egg
in my virtual env, I get an error:
D:\Applications\tmp\test2>Scripts\pip.exe install zc.recipe.egg
Collecting zc.recipe.egg
Installing collected packages: zc.recipe.egg
zc.recipe.egg is in an unsupported or invalid wheel
The error message is in an unsupported or invalid wheel
is not very explicit and I do not know why pip 7.1.0 (and only this version of pip) is complaining about this egg ?
I only have this problem with this egg...
Does anyone have a clue on what this means, why it appeared when I change my pip version and if there is a way to fix it ?
OK... sorry... I was wrong about the versions...
Actually the problem appeared with the first 7.x version of pip. It is working with pip = 6.1.1, but not with pip = 7.0.1
I did not realize that immediately because I used virtualenv (which contains its own local pip version).
This seems not to be a problem on Linux
FWIW this problem affects Linux too:
$ pip install zc.recipe.egg==2.0.2
Collecting zc.recipe.egg==2.0.2
Downloading zc.recipe.egg-2.0.2.tar.gz
Requirement already satisfied (use --upgrade to upgrade): zc.buildout>=1.2.0 in /tmp/sandbox/lib/python2.7/site-packages (from zc.recipe.egg==2.0.2)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /tmp/sandbox/lib/python2.7/site-packages (from zc.recipe.egg==2.0.2)
Building wheels for collected packages: zc.recipe.egg
Running setup.py bdist_wheel for zc.recipe.egg
Stored in directory: /home/mg/.cache/pip/wheels/fb/91/64/02c3371f0177b8c2d9d4cc30c4d74be8dd60ab6e45970e260c
Successfully built zc.recipe.egg
Installing collected packages: zc.recipe.egg
zc.recipe.egg is in an unsupported or invalid wheel
AFAIU this happens for pip version 7.x, since that's when pip started building wheels for everything it installs.
Something inside pip/setuptools misidentifies the 'zc.recipe.egg' wheel as an egg, probably due to the name.
Sorry for the lack of feedback on this one, as I did not get any answer we found a workaround (not use zc.recipe.egg
), but it would be nice for it to work with pip (I would like to continue to install zc.recipe using pip...)
FWIW pip install --no-cache-dir zc.recipe.egg
seems to work as a workaround.
here's the hidden stack trace for this.
pkg_resources is confused by the "egg" in the name
Exception:
Traceback (most recent call last):
File "/home/qwcode/p/pypa/pip/pip/basecommand.py", line 200, in main
status = self.run(options, args)
File "/home/qwcode/p/pypa/pip/pip/commands/install.py", line 302, in run
root=options.root_path,
File "/home/qwcode/p/pypa/pip/pip/req/req_set.py", line 657, in install
**kwargs
File "/home/qwcode/p/pypa/pip/pip/req/req_install.py", line 805, in install
version = pip.wheel.wheel_version(self.source_dir)
File "/home/qwcode/p/pypa/pip/pip/wheel.py", line 559, in wheel_version
wheel_data = dist.get_metadata('WHEEL')
File "/home/qwcode/p/pypa/pip/pip/_vendor/pkg_resources/__init__.py", line 1611, in get_metadata
return self._get(self._fn(self.egg_info, name))
File "/home/qwcode/p/pypa/pip/pip/_vendor/pkg_resources/__init__.py", line 1722, in _get
with open(path, 'rb') as stream:
IOError: [Errno 2] No such file or directory: '/tmp/pip-build-ucnzjI/zc.recipe.egg/EGG-INFO/WHEEL'
This bug makes it very hard to use tox to test packages that depend on zc.recipe.egg :(
Forwarded to the setuptools bug tracker.
Let's close this since it's a setuptools bug
Let's not: setuptools (well, pkg_resources) is vendored by pip, so this bug will plague it until (1) the fix appears in setuptools, and (2) the new setuptools is re-vendored into pip.
Biting me too now :-(
The stable
build of the Zope RTD docs just now failed due to this bug.
pip 9.0.1 produces the following error, even though there is only a sdist on pypi. Luckily, using --no-binary zc.recipe.egg
lets it be installed:
$ pip install -v zc.recipe.egg
Using cached wheel link: file:////pip/wheels/cd/aa/8d/63b1f57fed8ea602154b4ab91db4ac5b388480a686fa01426e/zc.recipe.egg-2.0.3-py2.py3-none-any.whl
Cleaning up...
Exception:
Traceback (most recent call last):
File "//lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "//lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "//lib/python2.7/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "//lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "//lib/python2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file
check_dist_requires_python(dist)
File "//lib/python2.7/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python
feed_parser.feed(metadata)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 177, in feed
self._input.push(data)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/email/feedparser.py", line 99, in push
parts = data.splitlines(True)
AttributeError: 'NoneType' object has no attribute 'splitlines'
pip 9.0.1 produces the following error, even though there is only a sdist on pypi.
Note that this only happens in a clean virtualenv with pip
if the wheel
package is also installed. Otherwise pip 9.0.1 happily installs from the source package every time, as the absence of the wheel
package stops pip
from producing the wheel to be cached.
@leorochael: see https://github.com/pypa/setuptools/issues/462
@leorochael: see pypa/setuptools#462
@benoit-pierre, Thanks.
I've proposed a fix in pypa/setuptools#1116.
This issue was auto-closed by pypa/setuptools#1116.
I suggest reopening until the latest setuptools is revendored.
Could someone from this thread confirm that this is indeed fixed on the current master
branch?
I guess, not really. Hitting the following error now:
$ python -m pip install -v zc.recipe.egg-2.0.4-py2.py3-none-any.whl
Processing ./zc.recipe.egg-2.0.4-py2.py3-none-any.whl
Cleaning up...
Exception:
Traceback (most recent call last):
File "lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
wb.build(autobuilding=True)
File "lib/python2.7/site-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "lib/python2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file
check_dist_requires_python(dist)
File "lib/python2.7/site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python
feed_parser.feed(metadata)
File "/usr/lib/python2.7/email/feedparser.py", line 156, in feed
self._input.push(data)
File "/usr/lib/python2.7/email/feedparser.py", line 99, in push
data, self._partial = self._partial + data, ''
TypeError: cannot concatenate 'str' and 'NoneType' objects
Nevermind, this is with a released pip
not the master branch
With pip from master I get:
$ pip install zc.buildout/zc.recipe.egg_/dist/zc.recipe.egg-2.0.4-py2.py3-none-any.whl
Processing ./zc.buildout/zc.recipe.egg_/dist/zc.recipe.egg-2.0.4-py2.py3-none-any.whl
Requirement already satisfied: zc.buildout>=1.2.0 in ./zc.buildout/src (from zc.recipe.egg==2.0.4) (2.9.5.dev0)
Requirement already satisfied: setuptools in /home/leonardo/Workspace/buildout.wheel/lib/python2.7/site-packages (from zc.recipe.egg==2.0.4) (36.2.7)
Installing collected packages: zc.recipe.egg
Successfully installed zc.recipe.egg-2.0.4
Which seems to indicate the problem is solved.
Most helpful comment
FWIW
pip install --no-cache-dir zc.recipe.egg
seems to work as a workaround.