pypa/pip · error · UnsupportedWheel
{name} has an invalid wheel, {e}
Error message
{name} has an invalid wheel, {e} What it means
Error "{name} has an invalid wheel, {e}" thrown in pypa/pip.
Source
Thrown at src/pip/_internal/metadata/pkg_resources.py:151
metadata=InMemoryMetadata(metadata_dict, filename),
project_name=project_name,
)
return cls(dist)
@classmethod
def from_wheel(cls, wheel: Wheel, name: str) -> BaseDistribution:
try:
with wheel.as_zipfile() as zf:
info_dir, _ = parse_wheel(zf, name)
metadata_dict = {
path.split("/", 1)[-1]: read_wheel_metadata_file(zf, path)
for path in zf.namelist()
if path.startswith(f"{info_dir}/")
}
except zipfile.BadZipFile as e:
raise InvalidWheel(wheel.location, name) from e
except UnsupportedWheel as e:
raise UnsupportedWheel(f"{name} has an invalid wheel, {e}")
dist = pkg_resources.DistInfoDistribution(
location=wheel.location,
metadata=InMemoryMetadata(metadata_dict, wheel.location),
project_name=name,
)
return cls(dist)
@property
def location(self) -> str | None:
return self._dist.location
@property
def installed_location(self) -> str | None:
egg_link = egg_link_path_from_location(self.raw_name)
if egg_link:
location = egg_link
elif self.location:
location = self.locationView on GitHub (pinned to d7d0d0a394)
When it happens
Trigger: Thrown at src/pip/_internal/metadata/pkg_resources.py:151 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of pypa/pip@d7d0d0a394 (2026-08-04).
Data as JSON: /data/errors/a00d671b2a7fc2f8.json.
Report an issue: GitHub.