Skip to content
Snippets Groups Projects
Commit 5f212660 authored by jacques.grelet_ird.fr's avatar jacques.grelet_ird.fr
Browse files

modify netcdftime by cftime in pyinstaller hook-netCDF4.py

under Lib\site-packages\PyInstaller\hooks
parent e65e094e
No related branches found
No related tags found
No related merge requests found
...@@ -591,14 +591,22 @@ ModuleNotFoundError: No module named 'cftime' ...@@ -591,14 +591,22 @@ ModuleNotFoundError: No module named 'cftime'
Try solution may be found here: Try solution may be found here:
https://stackoverflow.com/questions/29067588/problems-building-python-distribion-containing-netcdf4 https://stackoverflow.com/questions/29067588/problems-building-python-distribion-containing-netcdf4
Unistall/install last netCDF4 version:
> pip uninstall netCDF4
> pip install netCDF4
Edit and modify:
C:\opt\python\Python37\Lib\site-packages\PyInstaller\hooks\hook-netCDF4.py
replace:
hiddenimports = ['netCDF4.utils', 'netcdftime']
with:
hiddenimports = ['netCDF4.utils', 'cftime']
remove the current pyinstaller: pip uninstall pyinstaller Version [1.4.0](https://pypi.python.org/pypi/netCDF4/1.4.0) released.
The netcdftime package is no longer included, it is now a separate
clone and install pyinstaller from the python3 branch (https://github.com/pyinstaller/pyinstaller) [package](https://pypi.python.org/pypi/cftime) dependency.
modify your .spec file from hiddenimports = [] to hiddenimports = ['netCDF4.utils', 'netcdftime']
https://github.com/pyinstaller/pyinstaller/pull/4422/commits/a6098d062e713ab93d71ccb021d3c61f4a6b3360
Tests unitaires avec unittest: Tests unitaires avec unittest:
-------------------- --------------------
...@@ -649,4 +657,4 @@ Merge made by the 'recursive' strategy. ...@@ -649,4 +657,4 @@ Merge made by the 'recursive' strategy.
1 file changed, 2 insertions(+) 1 file changed, 2 insertions(+)
create mode 100644 README.md create mode 100644 README.md
make test make test
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment