pip freeze:Invalid requirement, parse error at "'-ipap11h'"

Created on 30 May 2016  ·  18Comments  ·  Source: pypa/pip

  • Pip version: 8.1.2
  • Python version: 2.7.5
  • Operating System: Centos 7

    Description:

While trying to run pip freeze I got this message:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/commands/freeze.py", line 85, in run
    for line in freeze(**freeze_kwargs):
  File "/usr/lib/python2.7/site-packages/pip/operations/freeze.py", line 47, in freeze
    dependency_links
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 264, in from_dist
    req = dist.as_requirement()
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2562, in as_requirement
    return Requirement.parse(spec)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2833, in parse
    req, = parse_requirements(s)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2781, in parse_requirements
    yield Requirement(line)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
    raise RequirementParseError(str(e))
RequirementParseError: Invalid requirement, parse error at "'-ipap11h'"

What's the 'ipap11h'

auto-locked

Most helpful comment

To get a hotfix, just install the current master from github.

All 18 comments

Who can tell me why?

I think this is a duplicate of #3681.

I find pip-7.1.0 which is installed from yum install python-pip is ok,but when I upgrade it to pip-8.1.2 by pip install --upgrade pip,the same problem occurs again.

pip-8.1.0 installed by pip install pip==8.1.0 is ok

the usual cause for errors like that is, the operating system installed a packages with deliberately broken package name, pip got more strict from the setuptools update _boom_

I know that, but why pip-8.1.0 can work, is it a bug in pip-8.1.2 on CentOS 7.2?

I suspect this is similar to https://github.com/pypa/pip/issues/3666#issuecomment-218375005 In short, this was _intended_ to "break" in some previous version (leading dashes are not legal in package names), but there was a bug in pip that prevented everything from being checked right. That bug later got fixed, leading to 8.1.2 apparently becoming more correctly strict. That in turn, however exposed this "breakage" (which is because of a bad package, not a bug in pip itself, strictly speaking).

Once again, though, this is just like #3681, which was fixed with #3704 (pip ignores bad packages that are already installed). So at this point, you're just waiting on a new pip release for the fix. You can try the workarounds mentioned in the first bug report.

The above comments are correct, closing this now.

OK Thanks

发自我的 iPhone

在 Jun 5, 2016,19:21,Jason Madden [email protected] 写道:

I suspect this is similar to #3666 (comment) In short, this was intended to "break" in some previous version (leading dashes are not legal in package names), but there was a bug in pip that prevented everything from being checked right. That bug later got fixed, leading to 8.1.2 apparently becoming more correctly strict. That in turn, however exposed this "breakage" (which is because of a bad package, not a bug in pip itself, strictly speaking).

Once again, though, this is just like #3681, which was fixed with #3704 (pip ignores bad packages that are already installed). So at this point, you're just waiting on a new pip release for the fix. You can try the workarounds mentioned in the first bug report.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Simple workaround

sudo pip uninstall _ipap11helper

You are right,it works now,thank you.

发自我的 iPhone

在 Jun 21, 2016,15:58,lennybe [email protected] 写道:

Simple workaround

sudo pip uninstall _ipap11helper


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

If it still fails with 8.1.2

pip install pip==1.5.5

sudo pip uninstall _ipap11helper

It works well now thank you😄
发自我的 iPhone

在 Aug 11, 2016,18:39,Lenny [email protected] 写道:

If it still fails with 8.1.2

pip install pip==1.5.5

sudo pip uninstall _ipap11helper


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Can we please fix this by making pip freeze give warnings about invalid package names instead of failing? Non standard package names are common on most know distributions including Debian, Ubuntu, CentOS and RedHat.

This means that if you happen to upgrade pip on these platforms there is a high chance that you will not be able to use pip freeze.

@ssbarnea that is the fix, it was made already. But there hasn't been a release since it was merged. But you should know that, as you opened the initial bug where this was addressed.

I opened this bug 6 months ago, changed jobs but this bug is still hunting me -- I end-up dealing with it in a total different context.

Can't we just make hotfix releases for critical bugs like these?

To get a hotfix, just install the current master from github.

Hehe, we are talking about distributed testing here, we don't want to ship code from github, especially pip which I would call a core dependency.

At the moment I have great time adding ugly workarounds like pip!=8.1.1,!=8.1.2,>=8.1.0 :(

BTW, If pip project needs any help, I am more than willing to help. It is too important in my day to day work to have a high quality pip and I am more than pleased to help. I can make pull requests but I cannot make new releases :)

Was this page helpful?
0 / 5 - 0 ratings