You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to pip install pgadmin4 on a recent AWS Ubuntu image (Ubuntu 24.04.1 LTS) fails with the following error:
ERROR: Exception:
Traceback (most recent call last):
File "/home/ubuntu/venv/lib/python3.12/site-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
...
File "/home/ubuntu/venv/lib/python3.12/site-packages/pip/_vendor/packaging/specifiers.py", line 28, in _coerce_version
version = Version(version)
^^^^^^^^^^^^^^^^
File "/home/ubuntu/venv/lib/python3.12/site-packages/pip/_vendor/packaging/version.py", line 202, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
pip._vendor.packaging.version.InvalidVersion: Invalid version: '6.8.0-1014-aws'
The root of the problem seems to be the kernel image version, which is labelled like this:
$ uname -a
Linux ip-172-31-8-236 6.8.0-1014-aws #15-Ubuntu SMP Thu Aug 8 19:13:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
IIUC, the Python platform package uses uname to derive the platform.release.
Expected behavior
The pip command's Version class should not fail, and cause the installation to abort
pip version
pip 24.3.1
Python version
3.12
OS
Linux/Ubuntu on AWS
How to Reproduce
Launch an AWS Ubuntu image. I am using ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-20240827.
Login
pip install --break-system-packages pgadmin4
Output
$ pip install --break-system-packages pgadmin4
Defaulting to user installation because normal site-packages is not writeable
Collecting pgadmin4
Using cached pgadmin4-8.14-py3-none-any.whl.metadata (3.1 kB)
ERROR: Exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/cli/base_command.py", line 105, in _run_wrapper
status = _inner_run()
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/cli/base_command.py", line 96, in _inner_run
return self.run(options, args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/commands/install.py", line 379, in run
requirement_set = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/resolvelib/structs.py", line 156, in __bool__
return bool(self._sequence)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 174, in __bool__
return any(self)
^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 162, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 53, in _iter_built
candidate = func()
^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/factory.py", line 187, in _make_candidate_from_link
base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/factory.py", line 233, in _make_base_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 304, in __init__
super().__init__(
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 159, in __init__
self.dist = self._prepare()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 248, in _prepare
self._check_metadata_consistency(dist)
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/resolution/resolvelib/candidates.py", line 230, in _check_metadata_consistency
list(dist.iter_dependencies(list(dist.iter_provided_extras())))
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/metadata/importlib/_dists.py", line 220, in iter_dependencies
elif any(req.marker.evaluate(context) for context in contexts):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_internal/metadata/importlib/_dists.py", line 220, in <genexpr>
elif any(req.marker.evaluate(context) for context in contexts):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/markers.py", line 325, in evaluate
return _evaluate_markers(self._markers, current_environment)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/markers.py", line 211, in _evaluate_markers
groups[-1].append(_evaluate_markers(marker, environment))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/markers.py", line 225, in _evaluate_markers
groups[-1].append(_eval_op(lhs_value, op, rhs_value))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/markers.py", line 183, in _eval_op
return spec.contains(lhs, prereleases=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/specifiers.py", line 552, in contains
normalized_item = _coerce_version(item)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/specifiers.py", line 28, in _coerce_version
version = Version(version)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/pip/_vendor/packaging/version.py", line 202, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
pip._vendor.packaging.version.InvalidVersion: Invalid version: '6.8.0-1014-aws'
Description
Trying to
pip install pgadmin4
on a recent AWS Ubuntu image (Ubuntu 24.04.1 LTS) fails with the following error:The root of the problem seems to be the kernel image version, which is labelled like this:
IIUC, the Python
platform
package uses uname to derive theplatform.release
.Expected behavior
The pip command's
Version
class should not fail, and cause the installation to abortpip version
pip 24.3.1
Python version
3.12
OS
Linux/Ubuntu on AWS
How to Reproduce
ubuntu/images/hvm-ssd-gp3/ubuntu-noble-24.04-amd64-server-20240827
.Output
Code of Conduct
The text was updated successfully, but these errors were encountered: