Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when importing Iris #3937

Closed
MHBalsmeier opened this issue Dec 17, 2020 · 7 comments
Closed

Warning when importing Iris #3937

MHBalsmeier opened this issue Dec 17, 2020 · 7 comments

Comments

@MHBalsmeier
Copy link
Contributor

Hi,
the simple command

import iris

in python leads to

/home/ubuntu/.local/lib/python3.6/site-packages/iris/config.py:73: UserWarning: Ignoring config item 'Resources':'test_data_dir' (section:option) as '/home/h05/itwl/projects/git/iris-test-data/test_data' is not a valid directory path.
warnings.warn(msg.format(section, option, c_path))

What is this?

OS: Ubuntu 18.04
Python 3.6.9

@trexfeathers
Copy link
Contributor

trexfeathers commented Dec 18, 2020

Hi @MHBalsmeier. This suggests an Iris installation from a branch/fork other than SciTools/iris master. Following any of the instructions in Installing Iris should definitely avoid this warning (same for the less recommended pip install scitools-iris). How did you install your copy of Iris?

@MHBalsmeier
Copy link
Contributor Author

MHBalsmeier commented Dec 18, 2020

I did not want to use conda for various reasons, and it took me very long until I finally managed to sucessfully install iris. I wrote down all the steps that got me there in a gist:

https://gist.github.com/MHBalsmeier/a586426026aaee186edfbf1995018a2c

I applied this on various Ubuntu 20 machines / VMs and it worked fine, now I had to install it on a Ubuntu 18 machine and the warning came. It still works, I only wonder why this warning shows up.

@trexfeathers
Copy link
Contributor

trexfeathers commented Dec 18, 2020

Thanks for the detail @MHBalsmeier. From your description I'm at a loss to explain how this has happened, but here's the fix anyway:

If you open /home/ubuntu/.local/lib/python3.6/site-packages/iris/etc/site.cfg, I expect you will find this line, which is referencing someone else's local file:

test_data_dir = /home/h05/itwl/projects/git/iris-test-data/test_data

If you don't need to run any of Iris' test that require iris-test-data (I'm guessing so from your gist):
Just delete the offending line.

If you do need to use iris-test-data:
Delete the offending line, then...
Follow the recommended steps under Running the tests.

@MHBalsmeier
Copy link
Contributor Author

Thanks, this worked.

You mentioned that pip install scitools-iris is not recommended. As you see in my gist, I am doing pip install --user scitools-iris as well as later python setup.py build. Is the pip install unnecessary?

@trexfeathers
Copy link
Contributor

Is the pip install unnecessary?

I think so. My main uncertainty is how pip or setup.py handle dependencies; they both have access to the necessary dependency information (the individual .txt files in the requirements/ directory), but I can't be sure if pip is doing anything extra beyond what setup.py does. I suggest trying a fresh install without the pip step, and see if the core dependencies (see directory linked above) get installed anyway.

@trexfeathers
Copy link
Contributor

... of course for your use case the dependency management is handled anyway so I think you're safe to only use setup.py.

@MHBalsmeier
Copy link
Contributor Author

Okay, thanks, I'll try this next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants