pip: Listing outdated packages fails
Environment
- pip version: 18.0
- Python version: 3.7.0
- OS: Linux
Description
Uncaught exception occurs when checking for outdated packages, crashing pip. Apparently the version number is now a type, but does not support >
-comparison.
Expected behavior Print a list of outdated packages
How to Reproduce
Simply run pip list --outdated
Output
$ pip list --outdated
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/pip/_internal/basecommand.py", line 141, in main
status = self.run(options, args)
File "/usr/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 136, in run
packages = self.get_outdated(packages, options)
File "/usr/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 147, in get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/usr/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 148, in <listcomp>
if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'Version'
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (10 by maintainers)
Don’t use the distribution versions of setuptools/pkg_resources. Vendoring is there exactly to protect against this kind of issues. It really make no sense for a distribution like Arch Linux, whose pretty much always up-to-date, to unvendor pip/setuptools.
Yep, I can reproduce it too!
IMHO, any unvendored pip is a (subtly) broken pip…
I can’t reproduce this locally, with or without the distribution version of pip (I’m on Arch Linux too). What’s the output of
pip freeze --all
?