Open prosaicpudding opened 2 years ago
I think this is in fact a limitation of pyinstaller. https://github.com/pyinstaller/pyinstaller/issues/4795 Checking to see if the copy_metadata hook can be used to resolve the issue.
Hmm I got it working for Python 3 using pyinstaller hooks with your package (pyinstaller-hook-metadata) but I don't think it's going to work for Python 2. The latest PyInstaller that supported it was 3.6, and so far, I haven't figured out if there is a way to provide pyinstaller 3.6 the hooks.
I will see if I can use a different path to get the version of 'pyserial', which will simplify to from serial import __version__
, as I think it is still available when pyinstaller freezes the application.
š Feature Request
Ensure that this package is compatible with pyinstaller.
š Motivation
I have observed that importing this package into a project that is packaged into an executable with pyinstaller will break the resulting executable. Specifically, you see the following, even if pyserial is installed, and in fact is used elsewhere in the same program without issue:
I suspect this issue is related to how/where/when pyinstaller packages up dependencies. But I would like to build a minimum viable example to ensure that it isn't some idiosyncrasy of my project.
š° Alternatives
Rather than any code changes, we might also provide documentation on a known workaround.
š Additional context