zipapps icon indicating copy to clipboard operation
zipapps copied to clipboard

Crash when using importlib.metadata.version

Open gsemet opened this issue 1 year ago • 1 comments

Hi

When using

from importlib.metadata import version
version("name_of_my_package")

I get a crash importlib.metadata.PackageNotFoundError: No package metadata was found for name_of_my_package

I first create the wheel of my package and then create the

   zipapps --output dist/$(PACKAGE_NAME).pyz -u=AUTO
        -p '/usr/bin/env python3'
        -m name_of_my_package.cli:cli 
        -r dist/prod-requirements.txt 
        dist/name_of_my_package-*.whl

I think name_of_my_package.whl is well installed I see it in the pip install output, but it seems like the importlib does not find it when executed in the pyz generated by zipapps. It works with shiv.

gsemet avatar Jun 21 '23 08:06 gsemet