So I upgraded from iris 1.92 to 1.10 on Windows 64 on Conda and the trick of:
os.setcwd('c:')
import iris
fails with:
OSError: [UT_PARSE] Failed to open UDUNITS-2 XML unit database : "No such file or directory"
After some digging I tracked this down to a problem in cf_units and presumably how Ananconda installs packages,
I needed to edit C:\Anaconda2\Lib\site-packages\cf_units\__init__.py to modify line 378 to
_alt_xml_path = os.path.join(sys.prefix, 'Library','share',
from
_alt_xml_path = os.path.join(sys.prefix, 'share',
then the old hack works...
It would be good if someone more skilled than I in python could fix cf_units so
1) It looks for udunits2.xml file in sensible **places**.
On my system that is os.path.join(sys.prefix, 'Library','share', 'udunits', 'udunits2.xml')
but I imagine different systems make different choices,,
2) fixes the need to do os.setcwd('c:) & import cf_units
I note the code comments in cf_units refer to
UDUNITS2_XML_PATH env variable -- but I see no reads of this env variable in the __init__.py file.
Simon