<div dir="ltr">Graham,<div><br></div><div>Thanks so much for writing. This is quite a pickle and extremely annoying even for me--I was dealing with a similar issue on my own system yesterday. Here is the general problem: basemap is an &quot;extension&quot; of the matplotlib package. So even if you install basemap successfully but it does place it in the &quot;extension&quot; folder corresponding to the matplotlib that actually is imported, it won&#39;t work. This is a tricky problem anyway compounded by the issue that you have multiple python versions.</div><div><br></div><div>Let&#39;s diagnose a few things:</div><div><br></div><div>* Which version of python is your &quot;python&quot; command? I see you specifically ran &quot;/usr/local/sci/bin/python2.7&quot; when you setup ILAMB, but later use just &quot;python&quot;. My guess is that it is 2.7.xx but just to be sure run a:</div><div><br></div><div>python --version</div><div><br></div><div>* Where is the matplotlib that is getting loaded? The __path__ variable of a module is very useful in determining what in the world is going on. It gives the location of the module being imported.</div><div><br></div><div>python -c &quot;import matplotlib; print matplotlib.__path__&quot;</div><div><br></div><div>My guess is that while basemap is installed in &quot;/usr/local/sci/lib/python2.7/site-packages/&quot; your matplotlib which is being loaded is in &quot;.local/lib/python2.6/site-packages/&quot;. This would explain why basemap isn&#39;t getting loaded. </div><div><br></div><div>If this is the case, we just need to tell python to look for packages first in /usr/local/sci. Try exporting an environment variable (assuming bash):</div><div><br></div><div>export PYTHONPATH=/usr/local/sci/lib/python2.7:$PATH</div><div><br></div><div>This will give preference to the location where you have basemap installed. Ultimately, I had such problems with packages that I used pip to uninstall most everything I use frequently, and then reinstalled them all in one location. This is the spirit behind my recommendation to always install with the --user option. If everything is in one location, then you have a better shot at everything just working.</div><div><br></div><div>Let me know how it goes. I am starting to get more of these kinds of mails so I have made a users list for ILAMB in hopes that our discussion will be helpful for others, I am CC&#39;ing this list.</div><div><br></div><div>Nate</div><div><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 19, 2016 at 10:01 AM Weedon, Graham &lt;<a href="mailto:graham.weedon@metoffice.gov.uk">graham.weedon@metoffice.gov.uk</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Dear Nathan,<u></u><u></u></p>
<p class="MsoNormal">          I have been asked to evaluate the ILAMBv2.0 for use with JULES (the LSM used by the Met Office). Unfortunately, I am unable to complete the installation because setup.py is unable to find the basemap module. This seems to be caused
 by our having two installations of Python (both 2.6 and 2.7).<u></u><u></u></p>
<p class="MsoNormal">          I have run the setup.py for local installation as follows:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">wld006:/ilambv2.00/ $ /usr/local/sci/bin/python2.7 setup.py install –user<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">       but when I check the installation I get:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">wld006:/ilambv2.00/ $ python -c &quot;import ILAMB; print ILAMB.__version__&quot;  
<u></u><u></u></p>
<p class="MsoNormal">Traceback (most recent call last):<u></u><u></u></p>
<p class="MsoNormal">  File &quot;&lt;string&gt;&quot;, line 1, in &lt;module&gt;<u></u><u></u></p>
<p class="MsoNormal">  File &quot;/home/ih0300/hadgw/.local/lib/python2.6/site-packages/ILAMB/__init__.py&quot;, line 24, in &lt;module&gt;<u></u><u></u></p>
<p class="MsoNormal">    pkg = __import__(key, globals(), locals(), [froms[key]])<u></u><u></u></p>
<p class="MsoNormal">ImportError: No module named basemap<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have established that the module basemap is available within mpl_toolkits (within:    /usr/local/sci/lib/python2.7/site-packages/   ), but the path in the error message indicates that the code is looking for basemap within the local installation
 (i.e.:       .local/lib/python2.6/site-packages/   ).  As you flagged on the Installation webpage of ILAMBv2.0 the problem is that we have two installations of Python: i.e. Python2.6 (which doesn’t have mpl_toolkits) and Python2.7 (which does have mpl_toolkits
 and basemap inside).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Do you think  that the error returned during the installation check indicates that setup.py has not used the Python2.7 path that was specified? Or is there a mis-match between the path accessed in specifying “froms” within __init__.py and
 the Python2.7 path (NB I inserted the path to Python2.7:    #!/usr/local/sci/bin/python2.7     as the first line of __init__.py)?<u></u><u></u></p>
<p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal">  Any pointers would be greatly appreciated, thanks, Graham.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Dr Graham Weedon<br>
Hydrology Dataset Scientist<br>
Met Office (JCHMR)<br>
Maclean Building  Crowmarsh Gifford<br>
Wallingford  Oxfordshire  OX10 8BB  UK<br>
Tel: +44 (0)1491 692578  Fax: +44 (0)1491 692338<br>
E-mail: <a href="mailto:graham.weedon@metoffice.gov.uk" target="_blank">graham.weedon@metoffice.gov.uk</a>  Website:<a href="http://www.metoffice.gov.uk" target="_blank">www.metoffice.gov.uk</a><u></u><u></u></span></p>
<p class="MsoNormal"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

</blockquote></div></div>