Discussion:
Bug#912379: /usr/bin/pip3: TypeError on "list --outdated": uses different Version implementations
(too old to reply)
Ben Wiederhake
2018-10-30 21:00:02 UTC
Permalink
Package: python3-pip
Version: 9.0.1-2.3
Severity: normal
File: /usr/bin/pip3

Dear Maintainer,

I'm having trouble running this command:

pip3 list --outdated

Expected behavior: A list of outdated, local packages
Actual behavior: TypeError

Full error message:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in
main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 157, in
run
packages = self.get_outdated(packages, options)
File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 168, in
get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 169, in
<listcomp>
if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'Version'

This is not Debian #878082.

Arch had a similar problem, there it was a packaging error:

https://github.com/pypa/pip/issues/5429

Could it be that the Debian package has a similar issue?

Cheers,
Ben



-- System Information:
Debian Release: buster/sid
APT prefers testing-debug
APT policy: (500, 'testing-debug'), (500, 'stable-updates'), (500, 'stable-debug'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), LANGUAGE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-pip depends on:
ii ca-certificates 20170717
ii python-pip-whl 9.0.1-2.3
ii python3 3.6.6-1
ii python3-distutils 3.6.6-1

Versions of packages python3-pip recommends:
ii build-essential 12.5
ii python3-dev 3.6.6-1
ii python3-setuptools 40.2.0-1
ii python3-wheel 0.30.0-0.2

python3-pip suggests no packages.

-- no debconf information
BenWiederhake.GitHub
2019-01-09 21:50:03 UTC
Permalink
Control: found -1 18.1-4
Thanks

Hello,

still happens.

This is strictly necessary for the recommended "upgrade-all" method [1].
Pip currently has no other way to do this [2], and this feature is
blocked by other issues [3], so "list --outdated" will continue to be of
interest for a long time.

Cheers,
Ben

[1] https://stackoverflow.com/q/2720014/3070326
[2] https://github.com/pypa/pip/issues/4551
[3] https://github.com/pypa/pip/issues/988
Arnaldo Pirrone
2019-08-12 11:10:02 UTC
Permalink
Package: python3-pip
Version: 18.1-5
Followup-For: Bug #912379

Hi, the same is happening here:

Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_internal/cli/base_command.py", line
143, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/list.py", line
138, in run
packages = self.get_outdated(packages, options)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/list.py", line
149, in get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/usr/lib/python3/dist-packages/pip/_internal/commands/list.py", line
150, in <listcomp>
if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'Version'

according to https://github.com/pypa/pip/issues/5429
the bug is located downstream.



-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.2.0-8.1-liquorix-amd64 (SMP w/4 CPU cores; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8), LANGUAGE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python3-pip depends on:
ii ca-certificates 20190110
ii python-pip-whl 18.1-5
ii python3 3.7.3-1
ii python3-distutils 3.7.4-3

Versions of packages python3-pip recommends:
ii build-essential 12.6
ii python3-dev 3.7.3-1
ii python3-setuptools 41.0.1-1
ii python3-wheel 0.32.3-2

python3-pip suggests no packages.

-- no debconf information
Nye Liu
2020-01-10 08:20:01 UTC
Permalink
this bug is now more than a year old.

Please update python3-pip and python-pip packages to >19.1
Scott Kitterman
2020-03-17 14:50:02 UTC
Permalink
Post by Nye Liu
this bug is now more than a year old.
Please update python3-pip and python-pip packages to >19.1
The same problem still exists with 20.2 in unstable. It appears that the
fundamental problem is that pip uses a modified pkg_resources copy (despite
their own rules to not modify vendored code) and then blames downstreams for
unbundling (which they do support).

Scott K
Scott Kitterman
2020-04-01 03:10:01 UTC
Permalink
Post by Scott Kitterman
Post by Nye Liu
this bug is now more than a year old.
Please update python3-pip and python-pip packages to >19.1
The same problem still exists with 20.2 in unstable. It appears that the
fundamental problem is that pip uses a modified pkg_resources copy (despite
their own rules to not modify vendored code) and then blames downstreams for
unbundling (which they do support).
This turned out to be nonsense. Please ignore.

Scott K
Scott Kitterman
2020-04-01 03:30:01 UTC
Permalink
On Tue, 30 Oct 2018 21:50:36 +0100 Ben Wiederhake
Post by Ben Wiederhake
Package: python3-pip
Version: 9.0.1-2.3
Severity: normal
File: /usr/bin/pip3
Dear Maintainer,
pip3 list --outdated
Expected behavior: A list of outdated, local packages
Actual behavior: TypeError
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in
main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 157, in
run
packages = self.get_outdated(packages, options)
File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 168, in
get_outdated
dist for dist in self.iter_packages_latest_infos(packages, options)
File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 169, in
<listcomp>
if dist.latest_version > dist.parsed_version
TypeError: '>' not supported between instances of 'Version' and 'Version'
This is not Debian #878082.
https://github.com/pypa/pip/issues/5429
Could it be that the Debian package has a similar issue?
The problem turns out to be that setuptools and pip have different approaches
for managing the namespace for packages they vendor and they are incompatible.
Thanks to the incomparable dstufft for figuring it out. The attached patch
works around this incompatibility. I've tested it with pip 20.2 on unstable
and it resolves the issue. This or something similar should work on earlier
versions too.

Scott K

Loading...