'pip3 list' throws AssertionError

Bug #1445947 reported by Max Bowsher on 2015-04-19
84
This bug affects 17 people
Affects Status Importance Assigned to Milestone
python-pip (Debian)
Fix Released
Unknown
python-pip (Ubuntu)
Medium
Unassigned
Trusty
Medium
Unassigned
Wily
Medium
Unassigned

Bug Description

[Impact]

 * Not able show current list of installed packages, e.g. pip freeze.

[Test Case]

1 - install wily/trusty-liberty python-pip package
2 - pip freeze
3 - the following error is shown without the patch

Exception:
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/freeze.py", line 74, in run
req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags)
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 286, in from_dist
assert len(specs) == 1 and specs[0][0] == '=='
AssertionError

[Regression Potential]

 * None

The command 'pip3 list' is broken on vivid:

maxb@altimeter:~$ pip3 list
[snip]
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 80, in run
    self.run_listing(options)
  File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 142, in run_listing
    self.output_package_listing(installed_packages)
  File "/usr/lib/python3/dist-packages/pip/commands/list.py", line 151, in output_package_listing
    if dist_is_editable(dist):
  File "/usr/lib/python3/dist-packages/pip/util.py", line 367, in dist_is_editable
    req = FrozenRequirement.from_dist(dist, [])
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 299, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='
AssertionError

The problem is that the version string of python-apt is not PEP 440 compliant. Avoiding this crash is already fixed with a one-line patch upstream. Please consider cherry-picking https://github.com/pypa/pip/commit/6cab71f422f2425b4d2283023c9e955f9663dde6 into Vivid's pip.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: python3-pip 1.5.6-5ubuntu2
ProcVersionSignature: Ubuntu 3.19.0-14.14-generic 3.19.3
Uname: Linux 3.19.0-14-generic x86_64
ApportVersion: 2.17.2-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Apr 19 16:55:24 2015
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-05-29 (325 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
PackageArchitecture: all
SourcePackage: python-pip
UpgradeStatus: Upgraded to vivid on 2015-03-29 (20 days ago)

Max Bowsher (maxb) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-pip (Ubuntu):
status: New → Confirmed
Changed in python-pip (Ubuntu):
importance: Undecided → Medium

I do not have python-pip3 installed.

But I get this bug using "pip list":
$ pip list
adium-theme-ubuntu (0.3.4)
[.... long list ...]
Pyste (0.9.10)
Exception:
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

Changed in pip:
status: Unknown → New
Red Ink (redink) wrote :

A work-around would be great...

Joel (joel-kuntz-92) wrote :

Same thing for me with Ubuntu Gnome 15.04

Ooe (1337decker) wrote :

Same think with pip for Python 2.7. The pip version installed by default is almost 6 major versions behind the latest pip version.

David Jones (drj) wrote :

from a fresh install (I'm using docker image ubuntu:15.04 but other 15.04 installs should reproduce it too):

apt-get update
apt-get install -y python-pip python-apt

pip freeze

Changed in pip:
status: New → Fix Released
David Jones (drj) wrote :

Removing the ubuntu package and installing pip via its official installer, as suggested here https://github.com/pypa/pip/issues/1093#issuecomment-103127883, is an adequate workaround.

Liang Chen (cbjchen) wrote :
description: updated
Changed in python-pip (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Liang Chen (cbjchen)
tags: added: sts sts-sru

The attachment "wily debian patch" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Michael Terry (mterry) wrote :

This was fixed in xenial, so marking Fix Released. Will open a wily task for the SRU.

Changed in python-pip (Ubuntu):
assignee: Liang Chen (cbjchen) → nobody
status: In Progress → Fix Released
Michael Terry (mterry) wrote :

Thanks for the patch, Liang Chen! I've uploaded it to wily, so I'll subscribe the sru team.

Hello Max, or anyone else affected,

Accepted python-pip into wily-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-pip/1.5.6-7ubuntu1.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-pip (Ubuntu Wily):
status: New → Fix Committed
tags: added: verification-needed
Liang Chen (cbjchen) wrote :

The proposed package (1.5.6-7ubuntu1.2) works well for me.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-pip - 1.5.6-7ubuntu1.2

---------------
python-pip (1.5.6-7ubuntu1.2) wily; urgency=medium

  * fix legacy version format support (LP: #1445947):
    - d/p/fix_legacy_version_format_support.patch

 -- Liang Chen <email address hidden> Mon, 11 Apr 2016 23:54:29 -0400

Changed in python-pip (Ubuntu Wily):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for python-pip has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Liang Chen (cbjchen) wrote :

trusty also need the fix

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-pip (Ubuntu Trusty):
status: New → Confirmed
Changed in python-pip (Ubuntu Trusty):
importance: Undecided → Medium
Changed in python-pip (Ubuntu Wily):
importance: Undecided → Medium
affects: pip → ubuntu-translations
Changed in ubuntu-translations:
importance: Unknown → Undecided
status: Fix Released → New
no longer affects: ubuntu-translations
Changed in python-pip (Debian):
status: Unknown → Fix Released

Hello Max, or anyone else affected,

Accepted python-pip into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-pip/1.5.4-1ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in python-pip (Ubuntu Trusty):
status: Confirmed → Fix Committed
tags: removed: verification-done
tags: added: verification-needed
Liang Chen (cbjchen) wrote :

The package python-pip 1.5.4-1ubuntu4 is tested and it fixes the issue.

Liang Chen (cbjchen) on 2016-07-20
tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-pip - 1.5.4-1ubuntu4

---------------
python-pip (1.5.4-1ubuntu4) trusty-proposed; urgency=medium

  * fix legacy resion format support (LP: #1445947):
    - d/p/fix_legacy_version_format_support.patch

 -- Liang Chen <email address hidden> Mon, 27 Jun 2016 10:40:48 -0700

Changed in python-pip (Ubuntu Trusty):
status: Fix Committed → Fix Released
Louis Bouchard (louis) on 2016-11-09
tags: removed: sts-sru
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.