{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/xarray/issues/497","repository_url":"https://api.github.com/repos/pydata/xarray","labels_url":"https://api.github.com/repos/pydata/xarray/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/pydata/xarray/issues/497/comments","events_url":"https://api.github.com/repos/pydata/xarray/issues/497/events","html_url":"https://github.com/pydata/xarray/issues/497","id":97554858,"number":497,"title":"Better error message when reading netCDF4 file and netCDF4 not installed","user":{"login":"clarkfitzg","id":5356122,"avatar_url":"https://avatars.githubusercontent.com/u/5356122?v=3","gravatar_id":"","url":"https://api.github.com/users/clarkfitzg","html_url":"https://github.com/clarkfitzg","followers_url":"https://api.github.com/users/clarkfitzg/followers","following_url":"https://api.github.com/users/clarkfitzg/following{/other_user}","gists_url":"https://api.github.com/users/clarkfitzg/gists{/gist_id}","starred_url":"https://api.github.com/users/clarkfitzg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clarkfitzg/subscriptions","organizations_url":"https://api.github.com/users/clarkfitzg/orgs","repos_url":"https://api.github.com/users/clarkfitzg/repos","events_url":"https://api.github.com/users/clarkfitzg/events{/privacy}","received_events_url":"https://api.github.com/users/clarkfitzg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T21:07:49Z","updated_at":"2016-06-02T06:16:01Z","closed_at":null,"body":"Trying to load a file without netcdf4 dependency:\r\n\r\n```\r\nxray.open_dataset('20150629_ave_mrr.nc')\r\n\r\n...\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n/Users/clark.fitzgerald/projects/mrr/june29_analysis.py in <module>()\r\n      7 import xray\r\n      8\r\n----> 9 mrr = xray.open_dataset('20150629_ave_mrr.nc')\r\n\r\n/Users/clark.fitzgerald/anaconda/envs/xray_dev/lib/python2.7/site-packages/xray-0.5.2_98_g69f7386-py2.7.egg/xray/backends/api.pyc in open_dataset(filename_or_obj, group, decode_cf, mask_and_scale, decode_times, concat_characters, decode_coords, engine, chunks, lock)\r\n    166                 store = backends.NetCDF4DataStore(filename_or_obj, group=group)\r\n    167             elif engine == 'scipy':\r\n--> 168                 store = backends.ScipyDataStore(filename_or_obj)\r\n    169             elif engine == 'pydap':\r\n    170                 store = backends.PydapDataStore(filename_or_obj)\r\n\r\n/Users/clark.fitzgerald/anaconda/envs/xray_dev/lib/python2.7/site-packages/xray-0.5.2_98_g69f7386-py2.7.egg/xray/backends/scipy_.pyc in __init__(self, filename_or_obj, mode, format, group, writer, mmap)\r\n     95             filename_or_obj = BytesIO(filename_or_obj)\r\n     96         self.ds = scipy.io.netcdf_file(\r\n---> 97             filename_or_obj, mode=mode, mmap=mmap, version=version)\r\n     98         super(ScipyDataStore, self).__init__(writer)\r\n     99\r\n\r\n/Users/clark.fitzgerald/anaconda/envs/xray_dev/lib/python2.7/site-packages/scipy/io/netcdf.pyc in __init__(self, filename, mode, mmap, version)\r\n    216\r\n    217         if mode == 'r':\r\n--> 218             self._read()\r\n    219\r\n    220     def __setattr__(self, attr, value):\r\n\r\n/Users/clark.fitzgerald/anaconda/envs/xray_dev/lib/python2.7/site-packages/scipy/io/netcdf.pyc in _read(self)\r\n    506         if not magic == b'CDF':\r\n    507             raise TypeError(\"Error: %s is not a valid NetCDF 3 file\" %\r\n--> 508                             self.filename)\r\n    509         self.__dict__['version_byte'] = fromstring(self.fp.read(1), '>b')[0]\r\n    510\r\n\r\nTypeError: Error: 20150629_ave_mrr.nc is not a valid NetCDF 3 file\r\n```\r\n\r\nIt would be more helpful to suggest that the user install netcdf4."},"comment":{"url":"https://api.github.com/repos/pydata/xarray/issues/comments/223204734","html_url":"https://github.com/pydata/xarray/issues/497#issuecomment-223204734","issue_url":"https://api.github.com/repos/pydata/xarray/issues/497","id":223204734,"user":{"login":"Yafei777","id":13634822,"avatar_url":"https://avatars.githubusercontent.com/u/13634822?v=3","gravatar_id":"","url":"https://api.github.com/users/Yafei777","html_url":"https://github.com/Yafei777","followers_url":"https://api.github.com/users/Yafei777/followers","following_url":"https://api.github.com/users/Yafei777/following{/other_user}","gists_url":"https://api.github.com/users/Yafei777/gists{/gist_id}","starred_url":"https://api.github.com/users/Yafei777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yafei777/subscriptions","organizations_url":"https://api.github.com/users/Yafei777/orgs","repos_url":"https://api.github.com/users/Yafei777/repos","events_url":"https://api.github.com/users/Yafei777/events{/privacy}","received_events_url":"https://api.github.com/users/Yafei777/received_events","type":"User","site_admin":false},"created_at":"2016-06-02T06:16:01Z","updated_at":"2016-06-02T06:16:01Z","body":"Cool! You saved my time! Thank you!\r\n\r\nI just downloaded an nc file from noaa's esrl, and tried to read it using xarray, but it gave me the error message you mentioned above."}}
{"actor":{"display_login":"Yafei777"}}