Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#70104 - python-pip 20.3.1 fails on installing packages with expected string or bytes-like object

Attached to Project: Arch Linux
Opened by Andrew (deathangel908) - Sunday, 21 March 2021, 10:45 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 21 March 2021, 11:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Felix Yan (felixonmars)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


Installing packages from venv throws exception `expected string or bytes-like object`.

ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_internal/cli/", line 224, in _main
status =, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/cli/", line 180, in wrapper
return func(self, options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/commands/", line 320, in run
requirement_set = resolver.resolve(
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 121, in resolve
self._result = resolver.resolve(
File "/usr/lib/python3.9/site-packages/resolvelib/", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/lib/python3.9/site-packages/resolvelib/", line 347, in resolve
failure_causes = self._attempt_to_pin_criterion(name, criterion)
File "/usr/lib/python3.9/site-packages/resolvelib/", line 216, in _attempt_to_pin_criterion
satisfied = all(
File "/usr/lib/python3.9/site-packages/resolvelib/", line 217, in <genexpr>
self._p.is_satisfied_by(r, candidate)
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 95, in is_satisfied_by
return requirement.is_satisfied_by(candidate)
File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/", line 102, in is_satisfied_by
return spec.contains(candidate.version, prereleases=True)
File "/usr/lib/python3.9/site-packages/packaging/", line 790, in contains
item = parse(item)
File "/usr/lib/python3.9/site-packages/packaging/", line 57, in parse
return Version(version)
File "/usr/lib/python3.9/site-packages/packaging/", line 296, in __init__
match =
TypeError: expected string or bytes-like object
Additional info:
* package version(s): 20.3.1-1 (works in 20.2.4-1)
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:
1. create venv: `python3 -m venv --system-site-packages .venv`
2. Activate venv: `source .venv/bin/activate`
3. create requirements.txt with any dependency. E.g. `pyfcm==1.5.1`
4. Run `pip install -r requirements.txt`
This task depends upon

Comment by Eli Schwartz (eschwartz) - Sunday, 21 March 2021, 15:21 GMT
This works fine for me, both when I initialize the venv using --without-pip and when I let it bundle its own copy of ensurepip'ed pip.
Comment by Martin Molzer (WorldSEnder) - Monday, 31 May 2021, 15:26 GMT
Note the similarity to Can you double check that there is no --user install of setuptools that interferes with the system-wide installation?