<div dir="ltr"><div>Solved.<br><br></div>I found that closing RStudio and then installing GRASS extensions, and reopening RStudio afterwards solved the issue. Solution described <a href="http://osgeo-org.1560.x6.nabble.com/GRASS-GIS-7-0-stable-and-R-integration-issue-td5281770.html" target="_blank">here</a>.<br><div><br><div><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">James Duffy</b> <span dir="ltr"><<a href="mailto:james.philip.duffy@gmail.com" target="_blank">james.philip.duffy@gmail.com</a>></span><br>Date: 3 May 2017 at 14:44<br>Subject: Using g.extension in with rgrass7 in R<br>To: grass-user <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br><br><br><div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>I'm trying to use GRASS in RStudio using the 'rgrass7' pacakge.<br><br></div>So far I have:<br><br><i><b>library(rgrass7)<br><br>initGRASS(gisBase = "C:/OSGeo4W64/apps/grass/grass<wbr>-7.3.svn",<br>          gisDbase = "C:/Sandbox/RGRASS/",<br>          location = "TEST", mapset = "MAP1",override=TRUE)<br><br>in.rast <- "C:/Users/James/Desktop/15m_si<wbr>te2/subset_output/15m_site2_su<wbr>bset_ortho.tif"<br><br>execGRASS("r.in.gdal", flags="o", parameters=list(input=in.rast, output="ortho"))<br><br></b></i></div>Which works fine!<br><br></div>However, when I want to install an extension with:<br><br><b><i>execGRASS("g.extension", parameters=list(extension="i.s<wbr>egment.uspo", operation="add")) </i><br><br></b></div>I get the following error:<br><br><i><b>Downloading precompiled GRASS Addons <i.segment.uspo>...<br>ERROR: Variable 'LOCATION_NAME' not set<br>ERROR: Variable 'LOCATION_NAME' not set<br>ERROR: Variable 'LOCATION_NAME' not set<br>Traceback (most recent call last):<br>  File "C:/OSGeo4W64/apps/grass/grass<wbr>-7.3.svn/scripts/<a href="http://g.extension.py" target="_blank">g.extension.<wbr>py</a>", line 1737, in <module><br>    sys.exit(main())<br>  File "C:/OSGeo4W64/apps/grass/grass<wbr>-7.3.svn/scripts/<a href="http://g.extension.py" target="_blank">g.extension.<wbr>py</a>", line 1716, in main<br>    install_extension(source=sourc<wbr>e, url=url, xmlurl=xmlurl)<br>  File "C:/OSGeo4W64/apps/grass/grass<wbr>-7.3.svn/scripts/<a href="http://g.extension.py" target="_blank">g.extension.<wbr>py</a>", line 702, in install_extension<br>    blist = install_extension_xml(xmlurl, mlist)<br>  File "C:/OSGeo4W64/apps/grass/grass<wbr>-7.3.svn/scripts/<a href="http://g.extension.py" target="_blank">g.extension.<wbr>py</a>", line 922, in install_extension_xml<br>    write_xml_modules(xml_file, tree)<br>  File "C:/OSGeo4W64/apps/grass/grass<wbr>-7.3.svn/scripts/<a href="http://g.extension.py" target="_blank">g.extension.<wbr>py</a>", line 601, in write_xml_modules<br>    libgis_revison = grass.version()['libgis_revisi<wbr>on']<br>KeyError: 'libgis_revision'<br>Warning message:<br>running command 'g.extension.bat extension=i.segment.uspo operation=add' had status 1<br clear="all"></b></i><div><div><div><div><div><div><div><div><div><br></div><div>Can anyone tell me where I have to set the 'LOCATION_NAME' please?<br><br></div><div>Kind regards<span class="m_-4271956371130654526HOEnZb"><font color="#888888"><br><br></font></span></div><span class="m_-4271956371130654526HOEnZb"><font color="#888888"><div>James<br></div><div><br>-- <br><div class="m_-4271956371130654526m_-8797930625519409091gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(39,78,19)"><span style="font-family:tahoma,sans-serif"><font size="4"><b>James Duffy</b></font><br>PhD Researcher<br>Environment and Sustainability Institute<br>Penryn Campus<br>University of Exeter<br>Penryn<br>Cornwall<br>TR10 9FE</span></span><br></div></div></div></div></div></div>
</div></font></span></div></div></div></div></div></div></div></div></div>
</div><br><br clear="all"><br>-- <br><div class="m_-4271956371130654526gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(39,78,19)"><span style="font-family:tahoma,sans-serif"><font size="4"><b>James Duffy</b></font><br>PhD Researcher<br>Environment and Sustainability Institute<br>Penryn Campus<br>University of Exeter<br>Penryn<br>Cornwall<br>TR10 9FE</span></span><br></div></div></div></div></div></div>
</div></div></div>