Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install zc.recipe.egg using pip #404

Closed
nazrulworld opened this issue Jul 30, 2017 · 4 comments
Closed

Can't install zc.recipe.egg using pip #404

nazrulworld opened this issue Jul 30, 2017 · 4 comments

Comments

@nazrulworld
Copy link

nazrulworld commented Jul 30, 2017

We have a recipe https://pypi.python.org/pypi/plone.recipe.sublimetext/ that is dependent on zc.recipe.egg. When I tried to install using pip it fails, Lastly I find out problem is in zc.recipe.egg that can't be installed through pip.
Bellows are details

PIP Version: 9.0.1
Python: 2.7.12

Exception:
Traceback (most recent call last):
  File "/tmp/py2/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/tmp/py2/local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/tmp/py2/local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/tmp/py2/local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/tmp/py2/local/lib/python2.7/site-packages/pip/req/req_set.py", line 666, in _prepare_file
    check_dist_requires_python(dist)
  File "/tmp/py2/local/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 177, in feed
    self._input.push(data)
  File "/usr/lib/python2.7/email/feedparser.py", line 99, in push
    parts = data.splitlines(True)
AttributeError: 'NoneType' object has no attribute 'splitlines'
@jamadden
Copy link
Contributor

jamadden commented Jul 30, 2017

This is actually a limitation in pip...it assumes anything that ends in ".egg" is a Python egg file, which is obviously not the case.

The solution is pip's --no-binary argument:

pip install --no-binary=zc.recipe.egg zc.recipe.egg # or whatever depends on zc.recipe.egg

That can go in a requirements.txt too, of course.

Example:

$ pip install zc.recipe.egg
Collecting zc.recipe.egg
Exception:
Traceback (most recent call last):
  File "//site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "//site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "//site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "//site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "//site-packages/pip/req/req_set.py", line 666, in _prepare_file
    check_dist_requires_python(dist)
  File "//site-packages/pip/utils/packaging.py", line 48, in check_dist_requires_python
    feed_parser.feed(metadata)
  File "//2.7/email/feedparser.py", line 177, in feed
    self._input.push(data)
  File "//2.7/email/feedparser.py", line 99, in push
    parts = data.splitlines(True)
AttributeError: 'NoneType' object has no attribute 'splitlines'
$ pip install --no-binary=zc.recipe.egg zc.recipe.egg
Collecting zc.recipe.egg
  Using cached zc.recipe.egg-2.0.3.tar.gz
Collecting zc.buildout>=1.2.0 (from zc.recipe.egg)
  Using cached zc.buildout-2.9.4-py2.py3-none-any.whl
Requirement already satisfied: setuptools in ./site-packages (from zc.recipe.egg)
Skipping bdist_wheel for zc.recipe.egg, due to binaries being disabled for it.
Installing collected packages: zc.buildout, zc.recipe.egg
  Running setup.py install for zc.recipe.egg ... done
Successfully installed zc.buildout-2.9.4 zc.recipe.egg-2.0.3

@jamadden
Copy link
Contributor

Pip bug: pypa/pip#3028

@nazrulworld
Copy link
Author

Thank you so much @jamadden

@leorochael
Copy link
Contributor

We have a recipe https://pypi.python.org/pypi/plone.recipe.sublimetext/ that is dependent on zc.recipe.egg. When I tried to install using pip it fails, Lastly I find out problem is in zc.recipe.egg that can't be installed through pip.

@nazrulworld, why do you need to install it with pip? Isn't it better to let buildout itself install it?

In any case, the underlying bug, which is pypa/setuptools#462, has a proposed fix on pypa/setuptools#1116.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants