Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Iris cannot find UDUNITS on Windows #115

Closed
ocefpaf opened this issue Oct 8, 2015 · 9 comments
Closed

Iris cannot find UDUNITS on Windows #115

ocefpaf opened this issue Oct 8, 2015 · 9 comments

Comments

@ocefpaf
Copy link
Member

ocefpaf commented Oct 8, 2015

I am puzzled that this is happening again:

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

That happens in both the ioos and scitools versions of iris. I am not sure what is going on. Maybe my WindowsVM is broken. So I appreciate if someone else can test this and let me know if the package is working for them.

NB: I can see the site.cfg. It seems to be correctly created and is pointing to the right place to find the UDUNITS-2 DLL.

@rsignell-usgs
Copy link

Is this a sufficient test?
conda install iris
and then
import iris

@ocefpaf
Copy link
Member Author

ocefpaf commented Oct 8, 2015

I need to know if it is a clean environment in case you already have iris installed. A conda info and conda list output would help.

@ocefpaf
Copy link
Member Author

ocefpaf commented Oct 9, 2015

OK I can confirm that this only happens when starting Python from another hard disk letter. This is a Windows idiosyncrasy that I have no idea how to solve! Closing this.

@ocefpaf ocefpaf closed this as completed Oct 9, 2015
@ocefpaf
Copy link
Member Author

ocefpaf commented Oct 9, 2015

A workaround it is to load iris first and then switch directories using the os module.

import iris
import os
os.chdir('E:')

(See http://nbviewer.ipython.org/gist/ocefpaf/6b4fb5f5a019c0af0a08)

@rsignell-usgs
Copy link

Interesting. I imagine this windows workaround is likely useful in other situations as well.

@ocefpaf
Copy link
Member Author

ocefpaf commented Oct 9, 2015

Probably.

PS: To be honest I am very frustrate with that solution. There must be an easier and more "Windows natural way" to solve this.

@pelson
Copy link
Member

pelson commented Oct 9, 2015

I think this is a bug we need to fix so I'll re-open. Hopefully it will be a simple one...

@pelson pelson reopened this Oct 9, 2015
@ghost
Copy link

ghost commented Apr 11, 2016

Yeah this is biting me too. A couple of things I noticed (win64 anaconda),

first my xml database is not in the path provided by:

        _alt_xml_path = os.path.join(sys.prefix, 'share',
                                         'udunits', 'udunits2.xml')

I had to add 'Library' before 'share':

        _alt_xml_path = os.path.join(sys.prefix, 'Library', 'share',
                                         'udunits', 'udunits2.xml')

The second even resolving to the right directory didn't work. This might be too 'hacky' for cf_units but It would be possible to add the working directory switch directly to the init.py so windows users could continue to use this install without grief. This works for me:
image

@pelson
Copy link
Member

pelson commented Nov 1, 2017

Closed due to the deprecation of this repo. #250

@pelson pelson closed this as completed Nov 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants