Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: py_pex_binary fails with AmbiguousDistributionError #408

Open
harshalparekh6 opened this issue Oct 7, 2024 · 0 comments · May be fixed by #414
Open

[Bug]: py_pex_binary fails with AmbiguousDistributionError #408

harshalparekh6 opened this issue Oct 7, 2024 · 0 comments · May be fixed by #414
Labels
bug Something isn't working

Comments

@harshalparekh6
Copy link

What happened?

Building py_pex_binary fails with:

Traceback (most recent call last):
  File "/home/playground/.cache/bazel/_bazel_playground/33746cb7bfc65ca42552dbe5cbc93007/execroot/ntropy/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/aspect_rules_py/py/tools/pex/pex.runfiles/aspect_rules_py/py/tools/pex/main.py", line 162, in <module>
    dist = Distribution.load(dep + "/../")
  File "/home/playground/.cache/bazel/_bazel_playground/33746cb7bfc65ca42552dbe5cbc93007/execroot/ntropy/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/aspect_rules_py/py/tools/pex/pex.runfiles/.pex.venv/lib/python3.9/site-packages/pex/dist_metadata.py", line 885, in load
    return cls(location=location, metadata=DistMetadata.load(location))
  File "/home/playground/.cache/bazel/_bazel_playground/33746cb7bfc65ca42552dbe5cbc93007/execroot/ntropy/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/aspect_rules_py/py/tools/pex/pex.runfiles/.pex.venv/lib/python3.9/site-packages/pex/dist_metadata.py", line 805, in load
    metadata_files = load_metadata(location, restrict_types_to=restrict_types_to)
  File "/home/playground/.cache/bazel/_bazel_playground/33746cb7bfc65ca42552dbe5cbc93007/execroot/ntropy/bazel-out/k8-opt-exec-2B5CBBC6/bin/external/aspect_rules_py/py/tools/pex/pex.runfiles/.pex.venv/lib/python3.9/site-packages/pex/dist_metadata.py", line 363, in load_metadata
    raise AmbiguousDistributionError(
pex.dist_metadata.AmbiguousDistributionError: Found more than one distribution inside external/python3_9_x86_64-unknown-linux-gnu/lib/python3.9/site-packages/_distutils_hack/../:
pip-23.2.1.dist-info/METADATA
setuptools-68.2.2.dist-info/METADATA

Version

Development (host) and target OS/architectures:

Output of bazel --version:
bazel 6.5.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:
rules_py-0.8.2

Language(s) and/or frameworks involved:
python3.9

How to reproduce

py_binary(
    name = "binary",
    srcs = [
        "__init__.py",
    ],
    main = "__init__.py",
    visibility = ["//visibility:public"],
)

py_pex_binary(
    name = "py_pex_binary",
    binary = ":binary",
)


### Any other information?

_No response_
@harshalparekh6 harshalparekh6 added the bug Something isn't working label Oct 7, 2024
@thesayyn thesayyn linked a pull request Oct 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant