Unable to load iris package using "import iris" giving Runtime Error

912 views
Skip to first unread message

Paal Skjetne

unread,
Sep 15, 2021, 9:49:58 AM9/15/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools

I'v googled for solutions and I see that the second newest question on the python-iris tag has the exact same [problem] (Can you download SciTools Iris package on google colab?).

when running

import iris

I get the following error:

---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last) <ipython-input-3-20b42ed586e8> in <module> 1 import matplotlib.pyplot as plt 2 ----> 3 import iris 4 import iris.plot as iplt 5 import iris.quickplot as qplt c:\users\user\appdata\local\programs\python\python37\lib\site-packages\iris\__init__.py in <module> 20 - https://pypi.org/project/irisapi/ 21 - https://iris.claims/ ---> 22 """) 

RuntimeError: Ambiguous 'iris' package. 

Please use either: 
 **illumon-iris** 
- Python integration for Illumon Iris, a time-series database 
     - pip install illumon-iris 
 **SciTools Iris** 
- Python library for analysing and visualising meteorological and oceanographic data sets 
**info.gianlucacosta.iris** 
- A general-purpose library for Python 
    - pip install info.gianlucacosta.iris 
**irisapi** 
- Iris is a highly configurable and flexible service for paging and messaging 
    - pip install irisapi 

If I do a

conda list

I find the following packages installed:

idna                      2.10               pyhd3eb1b0_0
importlib-metadata        4.8.1            py37h03978a9_0  conda-forge
intel-openmp              2021.3.0          h57928b3_3372  conda-forge
iris                      3.0.4            py37h03978a9_0  conda-forge
jbig                      2.1               h8d14728_2003  conda-forge
jinja2                    3.0.1              pyhd8ed1ab_0  conda-forge
jpeg                      9d                   h8ffe710_0  conda-forge

which is the correct iris package and the only iris package installed on the system. Still at runtime when loading one of the iris example codes from SciTools Iris package I get the above runtime error.

As I mentioned to begin with I have googled around and I found one post that allures to the fact that there are many packages that want to claim the iris name and that the SciTools Iris was not one of these. There is a git-hub site for the specific runtime error as well!!! https://github.com/devinrsmith/iris

Not sure if this is put there as a form of copyright since I at best have a white belt if any in python/python politics.

But does anyone have the secret command that will allow me to run the iris examples or simply use the iris package from SciTools??? The solution should be added to the said github repo for the errormessage. I guess there is two solutions here (a) the SciTools guys claim iris-scitools or some other catchy name, or some python venv / pipenv or conda command to force the one that is downloaded. Sorry if this is a nube question.

RuthC

unread,
Sep 22, 2021, 4:38:35 AM9/22/21
to SciTools (iris, cartopy, cf_units, etc.) - https://github.com/scitools
I cannot reproduce this error on Google Colab.  When trying to run an example, I did get an error that was something to do with numpy so upgraded that.  So this is what worked for me:

!pip install scitools-iris
!pip install numpy --upgrade
!pip install iris-sample-data

Then I copied and pasted this gallery example, and it just worked.

Note that Iris v3.1 has now been released.  I don't know if that makes a difference.

Ruth

Reply all
Reply to author
Forward
0 new messages