Hi Moritz.<br />First of all thank you for your very quick answer.<br />I tried both suggested solution. The first one, try to manually change the script, didn't work.<br />But luckily use OSGeo Live 10 is an option for me and I just finished to install the latest version and to download all the required add-ons.<br />Both r.neighborhoodmatrix and i.segment.uspo now work well :-)<br /><br />Thank you again <br /><br />Michele<br /><br /><span>On 07/03/17 17:55, <b class="name">Moritz Lennert </b> <mlennert@club.worldonline.be> wrote:</span><blockquote cite="mid:c4771d96-4d66-ed79-0b37-b6f99fb480f3@club.worldonline.be" class="iwcQuote" style="border-left: 1px solid #00F; padding-left: 13px; margin-left: 0;" type="cite"><div class="mimetype-text-plain">Hi Michele !<br /><br />On 07/03/17 17:27, Michele Zurlo wrote:<br />>Hi I'm Michele and this is my first e-mail in this mailing list and I<br />>hope to find a little help :-)<br />>I'm working to classify some UAV images and I would like to follow the<br />>method proposed by Grippa et al. 2016<br />><<a href="http://proceedings.utwente.nl/367/1/Grippa-An%20Open-Source%20Semi-Automated%20Processing%20Chain%20For%20Urban%20OBIA%20Classification-28.pdf" target="l">http://proceedings.utwente.nl/367/1/Grippa-An%20Open-Source%20Semi-Automated%20Processing%20Chain%20For%20Urban%20OBIA%20Classification-28.pdf</a>><br />>working with i.segment.uspo<br />><<a href="https://grass.osgeo.org/grass72/manuals/addons/i.segment.uspo.html" target="l">https://grass.osgeo.org/grass72/manuals/addons/i.segment.uspo.html</a>>.<br />>So I downloaded and installed the OSGEO Live 9.5 and from GRASS shell I<br />>installed i.segment.uspo<br />><<a href="https://grass.osgeo.org/grass72/manuals/addons/i.segment.uspo.html" target="l">https://grass.osgeo.org/grass72/manuals/addons/i.segment.uspo.html</a>> and<br />>the required r.neighborhoodmatrix<br />><<a href="https://grass.osgeo.org/grass72/manuals/addons/r.neighborhoodmatrix.html" target="l">https://grass.osgeo.org/grass72/manuals/addons/r.neighborhoodmatrix.html</a>>.<br />>Everything went right but when I try to use i.segment.uspo<br />><<a href="https://grass.osgeo.org/grass72/manuals/addons/i.segment.uspo.html" target="l">https://grass.osgeo.org/grass72/manuals/addons/i.segment.uspo.html</a>> I<br />>get an error message because there is something wrong with<br />>r.neighborhoodmatrix<br />><<a href="https://grass.osgeo.org/grass72/manuals/addons/r.neighborhoodmatrix.html" target="l">https://grass.osgeo.org/grass72/manuals/addons/r.neighborhoodmatrix.html</a>>.<br />>This is the error message retrieved trying to use r.neighborhoodmatrix<br />><<a href="https://grass.osgeo.org/grass72/manuals/addons/r.neighborhoodmatrix.html" target="l">https://grass.osgeo.org/grass72/manuals/addons/r.neighborhoodmatrix.html</a>>:<br />><br />>#############################<br />>Traceback (most recent call last):<br />> File<br />>"/home/user/.grass7/addons/scripts/r.neighborhoodmatrix",<br />>line 137, in <module><br />> main()<br />> File<br />>"/home/user/.grass7/addons/scripts/r.neighborhoodmatrix",<br />>line 123, in main<br />> unique_neighbors_sorted =<br />>gscript.natural_sort(unique_neighbors)<br />>AttributeError: 'module' object has no attribute<br />>'natural_sort'<br />>#############################<br />><br />>I tried to re-install the module but I retrieved the same message.<br />>Someone can help me?<br /><br />This sounds like OSGeo Live 9.5 contains a version of GRASS GIS that did not have this natural_sort in the GRASS Python scripting library, yet.<br /><br />Is using OSGeo Live 10 an option for you ? This contains GRASS 7.0.4 which is the first version that contains natural_sort as a utility function.<br /><br />Otherwise, it is quite easy to introduce it manually in the script. Copy the following into /home/user/.grass7/addons/scripts/r.neighborhoodmatrix, just before the "def cleanup():" line:<br /><br />def natural_sort(l):<br /> """Returns sorted strings using natural sort<br /> """<br /> convert = lambda text: int(text) if text.isdigit() else text.lower()<br /> alphanum_key = lambda key: [convert(c) for c in re.split('([0-9]+)', key)]<br /> return sorted(l, key=alphanum_key)<br /><br />Moritz<br /></div></blockquote>