Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.24k stars 413 forks source link

building from the cloned git repository #1068

Open SaTjemkes opened 5 years ago

SaTjemkes commented 5 years ago

FYI

hi I am running python 3.7 with latest netcdf distribution. if i install metpy using pip i get an incompatibility problem with my netcdf installation. so i cloned the metpy from the github system and tried to

python3 setup.py build pythone3 setup.py install

which worked fine, but then the install egg is not consistent with the python3.7 rules (I assume) I assume python3.7 expects to be the generated MetPy-0.10.0+73.gd3c29401-py3.7.egg to be a directory, were it is a regular file. Hence the system breaks.

as an example i have for scipy the following directory: scipy-1.4.0.dev0+aef60c7-py3.7-linux-x86_64.egg which contains EGG-INFO scipy

or a local generated package hypsatinst-0.1.0-py3.7.egg: EGG-INFO hypsatinst

I noted that it was also reported for python3.6

zbruick commented 5 years ago

Yeah this looks similar to #988, which is on the list to address. What netCDF-python version do you have that's causing the incompatibility issue? MetPy doesn't have a dependency on netCDF-python, so I'm curious what the issue is here with pip install.

SaTjemkes commented 5 years ago

Hi

I guess there is a netcdf reader in the distribution of metpy If I import the metpy

import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import SkewT from metpy.units import units

I can not read my netcdf files

If I comment these out then I have no problem

Error message

? File "/tcenas/home/l2vdpope/hidpf_diagnostic/hidpf_diagnostic/DisplayRetrieval.py", line 101, in dataset =L2vdpLevel2InterfaceClass(product_file_path=product_file_path, meta_product_file=meta_product_file) File "/tcenas/home/l2vdpope/.local/lib/python3.7/site-packages/hypsatinst-0.1.0-py3.7.egg/hypsatinst/ProductInterfaces/L2vdpLevel2InterfaceModule.py", line 39, in init self._readdimensions() File "/tcenas/home/l2vdpope/.local/lib/python3.7/site-packages/hypsatinst-0.1.0-py3.7.egg/hypsatinst/ProductInterfaces/L2vdpLevel2InterfaceModule.py", line 62, in _readdimensions ncfile = Dataset(self.meta_product_file,'r') File "/tcenas/home/l2vdpope/.local/lib/python3.7/site-packages/netCDF4/_netCDF4.cpython-37m-x86_64-linux-gnu.so", line 2291, in netCDF4._netCDF4.Dataset.init File "/tcenas/home/l2vdpope/.local/lib/python3.7/site-packages/netCDF4/_netCDF4.cpython-37m-x86_64-linux-gnu.so", line 1855, in netCDF4._netCDF4._ensure_nc_success

builtins.OSError: [Errno -101] NetCDF: HDF error: b'/tcenas/home/l2vdpope/hidpf_project_data/archive/products/1.2.3.0/noaa/m02/cris_xxx_1b/20180723/L2VDP-META-J01-CRIS-1B-20180723213948Z-20180723214140Z-20190614142143Z'

From: Zach Bruick notifications@github.com Sent: Monday 24 June 2019 16:26 To: Unidata/MetPy MetPy@noreply.github.com Cc: Stephen A. Tjemkes Stephen.Tjemkes@eumetsat.int; Author author@noreply.github.com Subject: Re: [Unidata/MetPy] building from the cloned git repository (#1068)

Yeah this looks similar to #988https://github.com/Unidata/MetPy/issues/988, which is on the list to address. What netCDF-python version do you have that's causing the incompatibility issue? MetPy doesn't have a dependency on netCDF-python, so I'm curious what the issue is here with pip install.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Unidata/MetPy/issues/1068?email_source=notifications&email_token=AKGKL76RNQCWTBQHCCWBTWDP4DKPFA5CNFSM4H26TDUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYNDGAA#issuecomment-505033472, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKGKL7Z4QPOMLA2EQR6Y5LTP4DKPFANCNFSM4H26TDUA.

Any email message from EUMETSAT is sent in good faith but shall neither be binding nor construed as constituting a commitment by EUMETSAT, except where provided for in a written agreement or contract or if explicitly stated in the email. Please note that any views or opinions presented in this email are solely those of the sender and do not necessarily represent those of EUMETSAT. This message and any attachments are intended for the sole use of the addressee(s) and may contain confidential and privileged information. Any unauthorised use, disclosure, dissemination or distribution (in whole or in part) of its contents is not permitted. If you received this message in error, please notify the sender and delete it from your system.

SaTjemkes commented 5 years ago

netCDF4 (1.5.1.2) - Provides an object-oriented python interface to the netCDF version 4 library. INSTALLED: 1.5.1.2 (latest)

Is the netcdf module used

From: Zach Bruick notifications@github.com Sent: Monday 24 June 2019 16:26 To: Unidata/MetPy MetPy@noreply.github.com Cc: Stephen A. Tjemkes Stephen.Tjemkes@eumetsat.int; Author author@noreply.github.com Subject: Re: [Unidata/MetPy] building from the cloned git repository (#1068)

Yeah this looks similar to #988https://github.com/Unidata/MetPy/issues/988, which is on the list to address. What netCDF-python version do you have that's causing the incompatibility issue? MetPy doesn't have a dependency on netCDF-python, so I'm curious what the issue is here with pip install.

SaTjemkes commented 5 years ago

Hi Zach

Order does matter As indicated yesterday I use the netcdf4 module which is using a locally compiled hdf5, and netcdf library. So if I load my libraries first and then the metpy module, then it will find the locally compiled libraries:

So this works (at least I can read my own files):

from hypsatinst.ProductInterfaces.L2vdpLevel2InterfaceModule import L2vdpLevel2InterfaceClass import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import SkewT from metpy.units import units

the other order

import metpy.calc as mpcalc from metpy.cbook import get_test_data from metpy.plots import SkewT from metpy.units import units from hypsatinst.ProductInterfaces.L2vdpLevel2InterfaceModule import L2vdpLevel2InterfaceClass

Not.

Might be of interest for future cases

Let see if I now can generate some plots

zbruick commented 5 years ago

Hi - just following up on this issue. So #988 was resolved magically in the MetPy 0.10.2 release. Could you try installing this version via pip and see if you are still getting the same issue with your netcdf-python version? Thanks!

SaTjemkes commented 5 years ago

Hi - the problem encountered was for MetPy 0.10.2, which was installed using pip3. Just to make sure I removed metpy 0.10.2, updated pip to the latest version, and installed metpy 0.10.2 again. Unfortunately did not make a difference. Thank you for the effort, stephen