[ilamb-users] CESM Meeting - Installing ILamb

Nathan Collier nathaniel.collier at gmail.com
Wed Jul 20 08:42:04 EDT 2016


Marysa,

The cfunits python package is a wrapper around the UDunits library--that
is, the python package itself doesn't do so much, it calls the library from
within python. So what is happening here is that when we try to import
cfunits, it looks for the UDunits library but cannot find it.

If you have not installed the UDunits library (it does not install
automatically with cfunits), then you will need to do so. More details can
be found here:

https://bitbucket.org/cfpython/cfunits-python

In particular they write:

"Requires the UNIDATA Udunits-2 library. This is a C library which provides
support for units of physical quantities. If The Udunits-2 shared library
file (libudunits2.so.0 on Linux or libudunits2.0.dylibfile on Mac OS) is in
a non-standard location then its path should be added to the
LD_LIBRARY_PATH environment variable."

So you may just need to install that library. On my Mac I use homebrew and
was able to install it using that--I imagine it is also available on
MacPorts. If it is installed, then you need to post-pend its location to
the above mentioned variable:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:PATH_TO_YOUR_UDUNITS_LIB

Let me know if that helps. Also, I am starting to get more mail along these
lines so we started a ILAMB users mailing list. I am going to CC this mail
to that list as well. Hopefully it will get people the help they need more
quickly.

Thanks,
Nate


On Mon, Jul 18, 2016 at 3:03 PM Marysa Laguë <mlague at uw.edu> wrote:

> Hi Nate,
>
> Thanks for checking in. I got some help from one of the more python-savvy
> grad students and we got past the problems with basemap/netcdf4. However,
> then we hit a new problem with a library not being found. First I ran:
>
> >> python setup.py install --user
>
>
> followed by
>
> >> python -c "import ILAMB; print ILAMB.__version__"
>
>
> which gave the following error (something about libudunits2.0.dylib):
>
> Traceback (most recent call last):
>
>   File "<string>", line 1, in <module>
>
>   File
> "/Users/mlague/.local/lib/python2.7/site-packages/ILAMB/__init__.py", line
> 26, in <module>
>
>     pkg = __import__(key)
>
>   File
> "/Users/mlague/anaconda/lib/python2.7/site-packages/cfunits/__init__.py",
> line 52, in <module>
>
>     from .units import Units
>
>   File
> "/Users/mlague/anaconda/lib/python2.7/site-packages/cfunits/units.py", line
> 39, in <module>
>
>     _udunits = ctypes.CDLL('libudunits2.0.dylib')
>
>   File "/Users/mlague/anaconda/lib/python2.7/ctypes/__init__.py", line
> 365, in __init__
>
>     self._handle = _dlopen(self._name, mode)
>
> OSError: dlopen(libudunits2.0.dylib, 6): image not found
>
> We googled this a bit and think it might have something to do with a lot
> of the permissions on the libraries changing when I unfortunately updated
> my mac to El Capitan (10.11.5) - that broke other things as well. At that
> point we kind of gave up, but if you have any suggestions, I'd be happy to
> hear them! If not, no worries - I think I'll ask our department's software
> people to just install ILAMB on our lab's server, which is where most of my
> model output is anyhow.
>
> Thanks again for checking in!
>
> Best,
>
> Marysa
>
> On Fri, Jul 15, 2016 at 7:29 AM, Nathan Collier <
> nathaniel.collier at gmail.com> wrote:
>
>> Marysa,
>>
>> Hope your summer is going well, I just wanted to follow up with you and
>> see if you were able to resolve your ILAMB issues?
>>
>> Take care,
>> Nate
>>
>> On Thu, Jun 23, 2016 at 4:00 PM Nathan Collier <
>> nathaniel.collier at gmail.com> wrote:
>>
>>> Marysa,
>>>
>>> Glad you enjoyed it, hopefully it helps you out in the long run! I know
>>> how confusing picking up a new language can be--and installation issues are
>>> so frustrating. My take is that the best thing I can do is explain the
>>> error message, and propose some tests to see how we might fix or understand
>>> it. When an error occurs in python, you get the entire 'stack'. This
>>> means that you get a statement of the error, and all the stuff that led up
>>> to that error. So this is the problem:
>>>
>>> *ImportError: numpy.core.multiarray failed to import*
>>>
>>> which is weird, because we thought we had numpy installed. But look more
>>> closely, who threw that error?
>>>
>>>
>>> *  File
>>> "/Users/mlague/anaconda/lib/python2.7/site-packages/netCDF4/__init__.py",
>>> line 3, in <module>**    from ._netCDF4 import **
>>>
>>> Here we see that it is the netCDF python wrapper which threw that error.
>>> Essentially, the netCDF wrapper imports numpy.core.multiarray and that
>>> failed for some reason. One encouraging thing I see here is that it is
>>> trying to load the netCDF version in the anaconda distribution (see the
>>> path?).
>>>
>>> So let's see what numpy your system is setup to use. Try typing in the
>>> following:
>>>
>>> python -c "import numpy; print numpy.__path__,numpy.__version__"
>>>
>>> which gives me:
>>>
>>> ['/usr/local/lib/python2.7/site-packages/numpy'] 1.10.1
>>> This tells me that I am using version 1.10.1 and it is installed in my
>>> user/local path. I would hope that yours is located in the anaconda
>>> directory and the version be somewhere around 1.9. However, based on your
>>> error messages, I believe that your python system is picking up an old
>>> numpy which didn't have multiarray.
>>>
>>> Happy to help,
>>> Nate
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wed, Jun 22, 2016 at 9:53 PM Marysa Laguë <mlague at uw.edu> wrote:
>>>
>>>> Dear Nate,
>>>>
>>>> Thanks for the great intro to getting ILAMB up and running today. I
>>>> talked to you briefly after the tutorial, as I was having trouble getting
>>>> ILAMB to install on my laptop - possibly because of problems with Anaconda?
>>>> (Its mac running 10.11.5).
>>>>
>>>> I'm very new to python, so if its just a python problem I can ask for
>>>> help from some of the more python-savvy people when I get back to my
>>>> school. However, in case you've had any ideas, here is a brief summary of
>>>> what went wrong.
>>>>
>>>> 1. Tried to install basemap using
>>>>
>>>> *conda install basemap*
>>>>
>>>>
>>>> 2. To install basemap, several existing packages had to be downgraded:
>>>>
>>>> *The following packages will be DOWNGRADED due to dependency conflicts:*
>>>> *    numexpr:      2.5.1-np111py27_0  --> 2.4.4-np19py27_0 *
>>>> *    numpy:        1.11.0-py27_0      --> 1.9.3-py27_1     *
>>>> *    scikit-learn: 0.17.1-np111py27_0 --> 0.16.1-np19py27_0*
>>>>
>>>>
>>>> 3. After saying "yes, install anyhow", I ran
>>>>
>>>> *python -c "import ILAMB; print ILAMB.__version__"*
>>>>
>>>>
>>>> This gave the following error:
>>>>
>>>>
>>>> *RuntimeError: module compiled against API version 0xa but this version
>>>> of numpy is 0x9*
>>>> *Traceback (most recent call last):*
>>>> *  File "<string>", line 1, in <module>*
>>>> *  File
>>>> "/Users/mlague/.local/lib/python2.7/site-packages/ILAMB/__init__.py", line
>>>> 26, in <module>*
>>>> *    pkg = __import__(key)*
>>>> *  File
>>>> "/Users/mlague/anaconda/lib/python2.7/site-packages/netCDF4/__init__.py",
>>>> line 3, in <module>*
>>>> *    from ._netCDF4 import ***ImportError: numpy.core.multiarray
>>>> failed to import*
>>>>
>>>> I'm not in a hurry to get ILamb running on my laptop - one of my
>>>> labmates was at the ILamb tutorial in May, so if I really want something in
>>>> the short term I'll just get him to run it.
>>>>
>>>> However, if you have any thoughts on what went wrong, I'd love to hear
>>>> them!
>>>>
>>>> Best,
>>>>
>>>> --
>>>> Marysa Laguë
>>>>
>>>> Graduate Student
>>>> Department of Atmospheric Sciences
>>>> Department of Applied Mathematics
>>>> Advisor: Abigail Swann
>>>> University of Washington
>>>>
>>>
>
>
> --
> Marysa Laguë
>
> Graduate Student
> Department of Atmospheric Sciences
> Department of Applied Mathematics
> University of Washington
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.ilamb.org/pipermail/ilamb-users/attachments/20160720/f260b6b4/attachment.html 


More information about the ilamb-users mailing list