barronh / pseudonetcdf

PseudoNetCDF like NetCDF except for many scientific format backends
GNU Lesser General Public License v3.0
77 stars 35 forks source link

pncdump ... invalid syntax #95

Closed miroi closed 4 years ago

miroi commented 4 years ago

Hello,

I just installed pseudonetcdf (see also https://github.com/barronh/pseudonetcdf/issues/94) on my Ubuntu 18.04, but got this Python error.

Any help, please ?

milias@194.160.44.72:~/work/open-collection/air-polution-modeling/CAMx/.pncdump
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 102, in _get_module_details
    loader = get_loader(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 462, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python2.7/pkgutil.py", line 472, in find_loader
    for importer in iter_importers(fullname):
  File "/usr/lib/python2.7/pkgutil.py", line 428, in iter_importers
    __import__(pkg)
  File "/usr/local/lib/python2.7/dist-packages/PseudoNetCDF/__init__.py", line 43, in <module>
    from PseudoNetCDF.core import PseudoNetCDFFile
  File "/usr/local/lib/python2.7/dist-packages/PseudoNetCDF/core/__init__.py", line 10, in <module>
    from ._files import PseudoNetCDFFile, netcdf, PseudoNetCDFVariables
  File "/usr/local/lib/python2.7/dist-packages/PseudoNetCDF/core/_files.py", line 1095
    print('|' + '=' * nitems + '|', flush=True)
                                         ^
SyntaxError: invalid syntax
milias@194.160.44.72:~/work/open-collection/air-polution-modeling/CAMx/.
barronh commented 4 years ago

The latest version of PseudoNetCDF uses python3 including flush. It looks like you're using version 2.7

miroi commented 4 years ago

Right. I switched to Python3 and it works now. Closing this issue as solved.