IRIS 2.0rc1 Install fails on cf_units

106 views
Skip to first unread message

Brian M Hamlin

unread,
Feb 8, 2018, 11:36:17 AM2/8/18
to Iris-dev
Hi - I had a chance to try installing the IRIS 2.0rc1 yesterday, and ran into a problem with cf_units. This is on Ubuntu 1604 Xenial and python 2.7, alongside a Jupyter 4 .   Perhaps there is a step I missed, but this is the error at this time  (tips appreciated):

--
/home/dbb/.local/lib/python2.7/site-packages/scitools_iris-2.0.0rc1-py2.7.egg/iris/_cube_coord_common.py in <module>()
     24 import string
     25 
---> 26 import cf_units
     27 
     28 import iris.std_names

/home/dbb/.local/lib/python2.7/site-packages/cf_units-1.2.0-py2.7.egg/cf_units/__init__.py in <module>()
    399             ctypes.set_errno(0)
    400         raise OSError('[%s] Failed to open UDUNITS-2 XML unit database %s' % (
--> 401             _status_msg, _error_msg))
    402 
    403 

OSError: [UT_OPEN_ARG] Failed to open UDUNITS-2 XML unit database : "No such file or directory"

In [4]: !ls /usr/share/xml/udunits
udunits2-accepted.xml  udunits2-base.xml  udunits2-common.xml  udunits2-derived.xml  udunits2-prefixes.xml  udunits2.xml

-- 

  the last bit of install looks something like this:

 2035  cd iris-2.0.0rc1/
 2036  ls
 2037  python setup.py clean
 2038  python setup.py build
 2039  python setup.py build_ext
 2040  python setup.py install --user
 2041  ipython
 2042  sudo ldconfig
 2043  ipython
 2044  cd ..
 2045  ls
 2046  cd udunits-2.2.26/
 2047  ls
 2048  less udunits2.info 
 2049  apt search udunits
 2050  sudo apt install libudunits2-dev
 2051  sudo apt install udunits-bin
 2052  cd ..
 2053  sudo ldconfig
 2054  ls
 2055  cd iris-2.0.0rc1/
 2056  ls
 2057  python setup.py clean
 2058  python setup.py build
 2059  python setup.py install --user
 2060  cd ..
 2061  sudo ldconfig
 2062  ipython
 2063  sudo updatedb
 2064  locate -i udunit
 2065  export UDUNITS2_XML_PATH=/usr/share/xml/udunits
 2066  ipython

Phil Elson

unread,
Feb 14, 2018, 12:35:58 PM2/14/18
to Brian M Hamlin, Iris-dev
I think cf-units doesn't use the UDUNITS2_XML_PATH environment variable (unfortunately).

The code suggests that you will need to configure cf_units with a file: https://github.com/SciTools/cf_units/blob/master/cf_units/__init__.py#L385

Specifically you will need a site.cfg in cf_units/etc/ that follows the following template: https://github.com/SciTools/cf_units/blob/master/cf_units/etc/site.cfg.template

You're welcome to raise an issue on the tracker that relates to this: https://github.com/SciTools/cf_units/issues


Cheers,

Phil

--
You received this message because you are subscribed to the Google Groups "Iris-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scitools-iris-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian M Hamlin

unread,
Mar 29, 2018, 11:12:17 PM3/29/18
to Iris-dev
yes, that does seem to do the trick. 
(following is the output of a somewhat-randomly picked test, which certainly imports cf_units )

iris_tests$ python test_analysis.py 
/home/dbb/.local/lib/python2.7/site-packages/scitools_iris-2.0.0rc1-py2.7.egg/iris/coords.py:1191: UserWarning: Collapsing a non-contiguous coordinate. Metadata may not be fully descriptive for 'lat'.
  warnings.warn(msg.format(self.name()))
/home/dbb/.local/lib/python2.7/site-packages/scitools_iris-2.0.0rc1-py2.7.egg/iris/coords.py:1191: UserWarning: Collapsing a non-contiguous coordinate. Metadata may not be fully descriptive for 'lon'.
  warnings.warn(msg.format(self.name()))
............../home/dbb/.local/lib/python2.7/site-packages/scitools_iris-2.0.0rc1-py2.7.egg/iris/coords.py:1191: UserWarning: Collapsing a non-contiguous coordinate. Metadata may not be fully descriptive for 'wibble'.
  warnings.warn(msg.format(self.name()))
.................sssssssssss.s/home/dbb/.local/lib/python2.7/site-packages/scitools_iris-2.0.0rc1-py2.7.egg/iris/coords.py:1191: UserWarning: Collapsing a non-contiguous coordinate. Metadata may not be fully descriptive for 'dummy'.
  warnings.warn(msg.format(self.name()))
.ssssssssssssssssssssssssssss............sssss
----------------------------------------------------------------------
Ran 90 tests in 0.317s

OK (skipped=45)
Reply all
Reply to author
Forward
0 new messages