<div dir="ltr">Marysa,<div><br></div><div>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. </div><div><br></div><div>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:</div><div><br></div><div><a href="https://bitbucket.org/cfpython/cfunits-python">https://bitbucket.org/cfpython/cfunits-python</a><br></div><div><br></div><div>In particular they write:</div><div><br></div><div>"<span style="line-height:1.5">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."</span></div><div><br></div><div>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:</div><div><br></div><div>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:PATH_TO_YOUR_UDUNITS_LIB</div><div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div>Nate</div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 18, 2016 at 3:03 PM Marysa Laguë <<a href="mailto:mlague@uw.edu">mlague@uw.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Nate,<div><br></div><div>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:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>>> python setup.py install --user</div></blockquote><div><br></div><div>followed by </div></div><div dir="ltr"><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div>>> python -c "import ILAMB; print ILAMB.__version__"</div></blockquote>
<div><br></div></div><div dir="ltr"><div>which gave the following error (something about libudunits2.0.dylib):</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"></blockquote></div><div dir="ltr"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><p><span>Traceback (most recent call last):</span></p></div><div><p><span> File "<string>", line 1, in <module></span></p></div><div><p><span> File "/Users/mlague/.local/lib/python2.7/site-packages/ILAMB/__init__.py", line 26, in <module></span></p></div><div><p><span> pkg = __import__(key)</span></p></div></blockquote></div><div dir="ltr"><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><p><span> File "/Users/mlague/anaconda/lib/python2.7/site-packages/cfunits/__init__.py", line 52, in <module></span></p></div><div><p><span> from .units import Units</span></p></div><div><p><span> File "/Users/mlague/anaconda/lib/python2.7/site-packages/cfunits/units.py", line 39, in <module></span></p></div><div><p><span> _udunits = ctypes.CDLL('libudunits2.0.dylib')</span></p></div><div><p><span> File "/Users/mlague/anaconda/lib/python2.7/ctypes/__init__.py", line 365, in __init__</span></p></div><div><p><span> self._handle = _dlopen(self._name, mode)</span></p></div><div><p><span>OSError: dlopen(libudunits2.0.dylib, 6): image not found</span></p></div></blockquote><div>
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.</div><div><br></div><div>Thanks again for checking in!</div><div><br></div><div>Best,</div><div><br></div><div>Marysa</div></div><div class="gmail_extra"></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 7:29 AM, Nathan Collier <span dir="ltr"><<a href="mailto:nathaniel.collier@gmail.com" target="_blank">nathaniel.collier@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Marysa,<div><br></div><div>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?</div><div><br></div><div>Take care,</div><div>Nate</div></div><div><div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 23, 2016 at 4:00 PM Nathan Collier <<a href="mailto:nathaniel.collier@gmail.com" target="_blank">nathaniel.collier@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Marysa,<div><br></div><div>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. <span style="line-height:1.5">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:</span></div></div><div dir="ltr"><div dir="ltr"><div><br></div><div><b style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">ImportError: numpy.core.multiarray failed to import</b><br></div><div><b style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></b></div></div></div><div dir="ltr"><div dir="ltr"><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif" size="2">which is weird, because we thought we had numpy installed. But look more closely, who threw that error?</font></div></div></div><div dir="ltr"><div dir="ltr"><div><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif" size="2"><br></font></div><div><b> File "/Users/mlague/anaconda/lib/python2.7/site-packages/netCDF4/__init__.py", line 3, in <module><br></b><b> from ._netCDF4 import *</b><font color="#212121" face="helvetica neue, helvetica, arial, sans-serif" size="2"><br></font></div><div><b><br></b></div></div></div><div dir="ltr"><div dir="ltr"><div>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?). </div><div><br></div><div>So let's see what numpy your system is setup to use. Try typing in the following:</div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">python -c "import numpy; print numpy.__path__,numpy.__version__"</span><br></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">which gives me:</span></div><div>
<p><span>['/usr/local/lib/python2.7/site-packages/numpy'] 1.10.1</span></p></div><div>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. </div><div><br></div><div>Happy to help, </div><div>Nate</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 22, 2016 at 9:53 PM Marysa Laguë <<a href="mailto:mlague@uw.edu" target="_blank">mlague@uw.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Nate,<div><br></div><div>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).</div><div><br></div><div>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.</div><div><br></div><div>1. Tried to install basemap using <br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><b>conda install basemap</b></div></blockquote><div><b><br></b></div><div>2. To install basemap, several existing packages had to be downgraded:<br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><b>The following packages will be DOWNGRADED due to dependency conflicts:</b></div><div><b> numexpr: 2.5.1-np111py27_0 --> 2.4.4-np19py27_0 </b></div><div><b> numpy: 1.11.0-py27_0 --> 1.9.3-py27_1 </b></div><div><b> scikit-learn: 0.17.1-np111py27_0 --> 0.16.1-np19py27_0</b></div></blockquote><div><div><br></div><div>3. After saying "yes, install anyhow", I ran<br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><b>python -c "import ILAMB; print ILAMB.__version__"</b></div></div></blockquote><div><div><br></div><div>This gave the following error:<br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><p><span><b>RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9<br></b></span><b>Traceback (most recent call last):<br></b><b> File "<string>", line 1, in <module><br></b><b> File "/Users/mlague/.local/lib/python2.7/site-packages/ILAMB/__init__.py", line 26, in <module><br></b><b> pkg = __import__(key)<br></b><b> File "/Users/mlague/anaconda/lib/python2.7/site-packages/netCDF4/__init__.py", line 3, in <module><br></b><b> from ._netCDF4 import *<br></b><b>ImportError: numpy.core.multiarray failed to import</b></p></div></div></blockquote><div><div>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.</div><div><br></div><div>However, if you have any thoughts on what went wrong, I'd love to hear them!</div><div><br></div><div>Best,</div></div></div><div dir="ltr"><div><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Marysa Laguë<div><br></div><div>Graduate Student</div><div>Department of Atmospheric Sciences</div><div>Department of Applied Mathematics</div><div>Advisor: Abigail Swann</div><div>University of Washington</div></div></div></div></div>
</div></div></blockquote></div></div></blockquote></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br></div><div class="gmail_extra"><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Marysa Laguë<div><br></div><div>Graduate Student</div><div>Department of Atmospheric Sciences</div><div>Department of Applied Mathematics</div></div></div></div></div></div><div class="gmail_extra"><div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>University of Washington</div></div></div></div></div>
</div>
</blockquote></div></div>