Closed happymvd closed 4 months ago
Looks like plugins are registed via xarray.backends
entry point, so that needs to be collected.
For now, try creating a custom hook that will override the one from pyinstaller-hooks-contrib
; i.e., create an extra-hooks
directory, and inside it, file called hook-xarray.py
, with the following contents:
# hook-xarray.py
from PyInstaller.utils.hooks import copy_metadata, collect_entry_point
# Collect additional backend plugins
datas, hiddenimports = collect_entry_point('xarray.backends')
# `xarray` requires `numpy` metadata due to several calls to its `xarray.core.utils.module_available` with specified
# `minversion` argument, which end up calling `importlib.metadata.version`.
datas += copy_metadata('numpy')
Then add --additional-hooks-dir extra-hooks
to your PyInstaller command.
@rokm Thank you for your quick response I did the following -
You omitted --collect-data gribapi
that you had in your original PyInstaller command; you need that to collect that gribapi\grib_api.h
file. So:
pyinstaller --onefile --additional-hooks-dir extra-hooks TryGrib.py --collect-data gribapi
@rokm With great gratitude, I salute you and your knowledge. I have spent many hours on this ...... thank you very very much
My test code -
this works in python from the terminal window, but when I compile the code using the following pyinstaller command line -
and then run the exe I get the following error message -
any help will be greatly appreciated