pipdeptree: `pipdeptree -u` crashes with "TypeError: expected string or bytes-like object"

Tested with git master.

Versions:

$ python ./pipdeptree.py -v
2.0.0b1
$ python -V
Python 3.8.6
$ pip -V
pip 20.2 from /usr/lib/python3.8/site-packages/pip (python 3.8)

Error message:

Traceback (most recent call last):
  File "/home/luxu/.local/bin/pipdeptree", line 8, in <module>
    sys.exit(main())
  File "/home/luxu/.local/lib/python3.8/site-packages/pipdeptree.py", line 596,
in main
    conflicting = conflicting_deps(tree)
  File "/home/luxu/.local/lib/python3.8/site-packages/pipdeptree.py", line 476,
in conflicting_deps
    if req.is_conflicting():
  File "/home/luxu/.local/lib/python3.8/site-packages/pipdeptree.py", line 264,
in is_conflicting
    return self.installed_version not in req_obj
  File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3125,
in __contains__
    return self.specifier.contains(item, prereleases=True)
  File "/usr/lib/python3.8/site-packages/packaging/specifiers.py", line 789, in
contains
    item = parse(item)
  File "/usr/lib/python3.8/site-packages/packaging/version.py", line 56, in parse
    return Version(version)
  File "/usr/lib/python3.8/site-packages/packaging/version.py", line 275, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object

Python modules installed in user home:

$ pip list --user
Package           Version
----------------- ----------
ads               0.12.3
astrocats         0.3.37
astropy           4.2
attrdict          2.0.1
babelfish         0.5.5
bashlex           0.15
bencoder.pyx      2.0.1
blinker           1.4
blist             1.3.6
bokeh             2.2.3
certifi           2020.11.8
compiledb         0.10.1
corner            2.1.0
Cython            0.29.21
dcnnt             0.3.6
dogpile.cache     1.1.1
dynesty           1.0.1
emcee             3.0.2
enzyme            0.4.1
extinction        0.4.5
feedparser        6.0.2
flatbencode       0.2.1
gitdb             4.0.5
gitdb2            4.0.2
GitPython         3.1.11
grbpy             0.3.0
guessit           3.1.1
html2text         2020.1.16
httpretty         1.0.3
inflect           5.0.2
ipython-genutils  0.2.0
jsonschema        3.2.0
jupyter-core      4.7.0
mock              4.0.2
mosfit            1.1.7
mpi4py            3.0.3
nbformat          5.0.8
nbstripout        0.3.9
numexpr           2.7.1
orderedattrdict   1.6.0
palettable        3.3.0
pandas            1.1.4
panwid            0.2.5
pbr               5.5.1
pipdeptree        2.0.0b1
pycryptodome      3.9.9
pyerfa            1.7.1.1
pyrsistent        0.17.3
pysrt             1.1.2
qbittorrent-api   2020.11.12
qbittorrentui     0.1.3
qr-filetransfer   2.7
qrcode            6.1
raccoon           3.0.0
rarfile           4.0
rebulk            2.0.1
schwimmbad        0.3.1
seaborn           0.11.0
selenium          3.141.0
setuptools-scm    4.1.2
sgmllib3k         1.0.0
shutilwhich       1.1.0
smmap             3.0.4
smmap2            3.0.1
stevedore         3.2.2
subliminal        2.1.0
tabulate          0.8.7
torf              3.1.3
tornado           6.1
tqdm              4.53.0
traitlets         5.0.5
transmissionrpc   0.11
typing-extensions 3.7.4.3
urwid             2.1.2
urwid-utils       0.1.2
Werkzeug          1.0.1
wheel             0.35.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I am really confused. If this is too complicated to debug, it can be put off for now, I don’t mind 😃

Me too 😃 Yeah, let’s put it off for now. I’ve pushed a commit in master branch that will handle the case.