indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.4k stars 234 forks source link

Runtime error related to `pkg_resources` #675

Open tatablack opened 1 year ago

tatablack commented 1 year ago

Hello 😌

MacOS 13.1 (M1) PyOxidizer 0.24.0 (using the default Python distribution for my platform, i.e. 3.10.9).

After a successful build, when trying to run the resulting executable I get:

Traceback (most recent call last):
  File "runpy", line 196, in _run_module_as_main
  File "runpy", line 86, in _run_code
  File "src.main", line 6, in <module>
  File "opentelemetry.exporter.otlp.proto.http.trace_exporter", line 38, in <module>
  File "opentelemetry.sdk.trace", line 58, in <module>
  File "opentelemetry.sdk.resources", line 139, in <module>
  File "pkg_resources", line 514, in get_distribution
  File "pkg_resources", line 386, in get_provider
  File "pkg_resources", line 956, in require
  File "pkg_resources", line 815, in resolve
  File "pkg_resources", line 856, in _resolve_dist
pkg_resources.DistributionNotFound: The 'opentelemetry-sdk' distribution was not found and is required by the application
error: cargo run failed

The issue is in a 3rd-party package, opentelemetry-exporter-otlp-proto-http.

I've found #378 and #236 , read the "Support for pkg_resources" section in the docs, and I was under the impression that it should just work (or rather, I'm not sure what to poke to make it work).

I've created a repo that reproduces the problem; it's possible to just clone it and run pyoxidizer run to see the error.

Any suggestions or documentation pointers? I'm just trying PyOxidizer for the first time, so I can't say that I've read all the docs 😅