読者です 読者をやめる 読者になる 読者になる

さこ街浪漫

GO ON A HIGHWAY

Ubuntu 14.04 LTS の pip list で謎の AssertionError

事象

pip list で謎の実行時例外

cat /root/.pip/pip.log
------------------------------------------------------------
/usr/bin/pip run on Sat Apr  2 08:30:48 2016
adium-theme-ubuntu (0.3.4)
apt-xapian-index (0.45)
argparse (1.2.1)
cffi (1.5.2)
chardet (2.0.1)
colorama (0.2.5)
command-not-found (0.3)
cryptography (1.3.1)
debtagshw (0.1)
defer (1.0.6)
dirspec (13.10)
distribute (0.7.3)
duplicity (0.6.23)
enum34 (1.1.2)
Flask (0.10.1)
html5lib (0.999)
httplib2 (0.8)
idna (2.1)
ipaddress (1.0.16)
itsdangerous (0.24)
Jinja2 (2.8)
lockfile (0.8)
lxml (3.3.3)
MarkupSafe (0.23)
oauthlib (0.6.1)
oneconf (0.3.7.14.4.1)
PAM (0.4.2)
pexpect (3.1)
Pillow (2.3.0)
pip (1.5.4)
piston-mini-client (0.7.5)
protobuf (2.6.1)
pyasn1 (0.1.9)
pycparser (2.14)
pycrypto (2.6.1)
pycups (1.9.66)
pygobject (3.12.0)
pyOpenSSL (16.0.0)
pyserial (2.6)
pysmbc (1.0.14.1)
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 366, in dist_is_editable
    req = FrozenRequirement.from_dist(dist, [])
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 286, in from_dist
    assert len(specs) == 1 and specs[0][0] == '=='
AssertionError
見解
  • apt-get で入れてしまった python-pip に問題がある模様。version が 1.5.4 とかよくわからないバージョンを示していた。
  • easy_install pip などが正解
環境
補足

python-pip のアンインストールは

# apt-get autoremove python-pip