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
BugFix: napari does not start with Python v3.11.1: "ValueError: A distribution name is required." #5482
Conversation
Thanks for the contribution! |
Codecov Report
@@ Coverage Diff @@
## main #5482 +/- ##
==========================================
- Coverage 89.40% 89.35% -0.06%
==========================================
Files 609 609
Lines 51146 51148 +2
==========================================
- Hits 45729 45705 -24
- Misses 5417 5443 +26
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
PR related to this PR: #5439, EDIT. IT will be nice to add some CI run for python 3.11 to our matrix. Without this we do not know if it is the only bug in 3.11 env. |
This LGTM, but I have a question: under what circumstances is |
start 24h clock
I do not know, but it is present for a long time. This what was changed is |
…tribution name is required." (#5482) Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…tribution name is required." (#5482) Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…tribution name is required." (#5482) Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…tribution name is required." (#5482) Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
…tribution name is required." (#5482) Co-authored-by: Grzegorz Bokota <bokota+github@gmail.com> Co-authored-by: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com>
Description
Summary
napari does not start with Python 3.11.1 as
importlib.metadata.Distribution
raisesValueError: A distribution name is required.
Solution
The solution is to add an additional check for empty
app_module
inrunning_as_bundled_app()
and return False if it is empty.Details
from_name()
function of Python'simportlib.metadata.Distribution
has been changed to check for the emptiness of thename
parameter in Python 3.11.1 (vs 3.11.0; see updated version here vs previous version ).napari.utils.misc.running_as_bundled_app()
callsimportlib.metadata.metadata()
with an emptyapp_module
parameter when running as stand-alone or using pytest.app_module
parameter is directly relayed toDistribution.from_name
, resulting in the following error when running napari with Python 3.11.1 (Ubuntu 22.04.1 LTS; napari pypi release 0.4.17 and github commit 54c1dbf )Type of change
References
How has this been tested?
as there are small differences between the two Qt bindings.
Final checklist:
trans.
to make them localizable.For more information see our translations guide.