pip: pip freeze crashes with Invalid requirement, parse error at "'-lxc==0'"
- Pip version: 8.1.2
- Python version: 3.4
- Operating System: Ubuntu 15.10
Description:
While trying to run pip freeze
we got a very long stacktrace that is ending with the line below:
file "/var/lib/jenkins/jobs/exampletech/jobs/example-portal/branches/devops/workspace/.tox/py34-linux/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2790, in __init__
raise RequirementParseError(str(e))
pip._vendor.pkg_resources.RequirementParseError: Invalid requirement, parse error at "'-lxc==0.'"
While I suspect that one of the packages installed from public pypi.python.org may have some weird version, i do find unacceptable to block pip freeze from working completely.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 39 (15 by maintainers)
That being said. We should probably just issue a warning and skip this package rather than bomb out completely.
Sent from my iPhone
@Mausy5043 Take a look at
/etc/apt/sources.list
. It should look something like this:I’m using the USA mirror, so YMMV. This page might also help.
Now it makes sense! Thanks. A fix for Xenial is in the SRU pipeline. If you have xenial-updates enabled, you should get the fix soon. It has to be approved by the SRU team, but I expect there shouldn’t be any hiccups with that.
@Mausy5043 That’s exactly what you should see.
pip
is a package that’s installed to a particular python version. AFAIK for most linux distros,pip
is installed withpython
andpip3
is installed withpython3
. Note, that it’s still thepip
package, regardless ofpython
orpython3
. The only difference is that withpip3
it does something likeln -s /path/to/python/bin/pip /usr/bin/pip3
.Agreed pip shouldn’t crash. A warning and skipping the package seems like a reasonable fix (as @dstufft suggested). PRs, as usual, welcome 😃
Also, help in making people more aware of the standards - either in the form of passing the word around, or PRs to documentation to clarify it, or as in this case bug reports to projects that don’t conform - is hugely appreciated. The biggest problem we have in Python packaging is making people aware when we tighten up risks/loopholes (as in this case), or enforce long-standing but previously ignored rules. So getting the word out is a great help.
The problem is very easy to replicate with any recent Ubuntu distribution (like 15.10). Just do
While I totally agree that the naming is not good, I find unacceptable to for pip to crash. That’s what we need to fix first, the pip failure.
We will always have broken package names, as we cannot control the ability of people to make mistakes. What we can do is to improve our ability to deal with them.