[Python-modules-team] Bug#786440: python-pip: pip is out-of-date, 'pip list' fails sometimes

Donald Stufft donald at stufft.io
Thu May 21 18:01:59 UTC 2015


I know that Barry is working on this, pip introduced several new dependencies
in 6.x that he had to package and get added to the archive before he could get
pip updated.


> On May 21, 2015, at 1:56 PM, Brian Warner <warner at lothar.com> wrote:
> 
> Package: python-pip
> Version: 1.5.6-5
> Severity: important
> 
> I noticed that 'pip list' on my sid system failed, with a rather obscure
> error:
> 
> Traceback (most recent call last):
>  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
>    status = self.run(options, args)
>  File "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 80, in run
>    self.run_listing(options)
>  File "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 142, in run_listing
>    self.output_package_listing(installed_packages)
>  File "/usr/lib/python2.7/dist-packages/pip/commands/list.py", line 151, in output_package_listing
>    if dist_is_editable(dist):
>  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 367, in dist_is_editable
>    req = FrozenRequirement.from_dist(dist, [])
>  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 299, in from_dist
>    assert len(specs) == 1 and specs[0][0] == '=='
> AssertionError
> 
> After some digging, it turned out that the problem was that I have the
> 'python-pyhsm' package installed, which has a version string of "1.0.4k",
> and the extra "k" causes pkg_resources to return a "spec" that looks like
> "=== 1.0.4k" (with three equal signs, not two), triggering the assert. Most
> packages have a "normalized" version string, for which pkg_resources emits
> a spec like "== 1.0.0", which doesn't cause pip to complain.
> 
> This was fixed in pip-6.0, which tolerates both == and ===. Sid currently
> has a pkg_resources that can emit ===, but not a pip that can tolerate it.
> This only shows up if you happen to have at least one python package
> installed with a non-normalized version string. For me, I was able to make
> pip work again by uninstalling python-pyhsm.
> 
> I'm sure you're aware that sid's pip-1.5.6 is pretty out-of-date, and that
> 6.1.1 is the current version (https://pip.pypa.io/en/stable/news.html).
> It's not a trivial upgrade, for sure, but consider this note as supporting
> evidence in the campaign to get pip updated :).
> 
> cheers,
> -Brian
> 
> 
> Steps To Reproduce:
> apt-get install python-pip python-pyhsm
> pip list
> Expected:
> a list of packages
> Got Instead:
> part of the list, then an exception with an AssertionError
> 
> cheers,
> -Brian
> 
> 
> -- System Information:
> Debian Release: stretch/sid
>  APT prefers unstable
>  APT policy: (500, 'unstable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: sysvinit (via /sbin/init)
> 
> Versions of packages python-pip depends on:
> ii  ca-certificates       20141019
> ii  python                2.7.9-1
> ii  python-colorama       0.3.3-1
> ii  python-distlib        0.2.0-1
> ii  python-html5lib       0.999-3
> ii  python-pkg-resources  16.0-1
> ii  python-requests       2.4.3-6
> ii  python-setuptools     16.0-1
> ii  python-six            1.9.0-3
> pn  python:any            <none>
> 
> Versions of packages python-pip recommends:
> ii  build-essential  11.7
> pn  python-dev-all   <none>
> ii  python-wheel     0.24.0-1
> 
> python-pip suggests no packages.
> 
> -- no debconf information
> 

---
Donald Stufft
PGP: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20150521/60f0a6a9/attachment-0002.sig>


More information about the Python-modules-team mailing list