cedadev/cf-checker

Fails to run with error ```AttributeError: module 'cftime' has no attribute 'utime'```

Opened this issue · 3 comments

I recently intalled cfchecker on Ubuntu 22.04:

~> pip install cfchecker
Defaulting to user installation because normal site-packages is not writeable
Collecting cfchecker
  Using cached cfchecker-4.1.0-py3-none-any.whl (36 kB)
Requirement already satisfied: netCDF4 in ./.local/lib/python3.8/site-packages (from cfchecker) (1.6.3)
Requirement already satisfied: numpy>=1.7 in ./.local/lib/python3.8/site-packages (from cfchecker) (1.24.2)
Requirement already satisfied: cfunits>=3.0.0 in ./.local/lib/python3.8/site-packages (from cfchecker) (3.3.1)
Requirement already satisfied: future in /usr/lib/python3/dist-packages (from cfchecker) (0.18.2)
Requirement already satisfied: cftime>=1.2.1 in ./.local/lib/python3.8/site-packages (from cfunits>=3.0.0->cfchecker) (1.6.2)
Installing collected packages: cfchecker
Successfully installed cfchecker-4.1.0

However, I am getting the error:

~> cfchecks --help
Traceback (most recent call last):
  File "/home/jrmet/.local/bin/cfchecks", line 5, in <module>
    from cfchecker.cfchecks import main
  File "/home/jrmet/.local/lib/python3.8/site-packages/cfchecker/cfchecks.py", line 73, in <module>
    from cfunits import Units
  File "/home/jrmet/.local/lib/python3.8/site-packages/cfunits/__init__.py", line 46, in <module>
    from .units import Units
  File "/home/jrmet/.local/lib/python3.8/site-packages/cfunits/units.py", line 2480, in <module>
    class Utime(cftime.utime):
AttributeError: module 'cftime' has no attribute 'utime'

Any idea why / how to fix?

I tried local install from source (latest commit from this github repo), and I get the same issue.

Hi - I think if you upgrade cfunits to the latest (3.3.5) everything should be OK.

@RosalynHatcher - could the requirements perhaps be updated for cfunits >= 3.3.5 and cftime >= 1.6.2 ?

Thanks,
David

(Note: installing from conda in a separate conda env works fine, so I will use this for now, but would be great if the pip install could work too :) ).