[GRASS-user] [GRASS-dev] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

Sandra MacFadyen sandramf at live.co.za
Thu May 22 00:20:39 PDT 2014


Hi Markus,

Thank you for your reponse.
I have updated r.diversity.py and r.diversity.html

I now get the following error:

> execGRASS("r.diversity",flags="overwrite", parameters=list(input="s1993_tm5_rad.1", prefix="s1993_tm5_rad_divers.1", alpha=0.5, size=5))
Error : XML content does not seem to be XML: '  File "C:/Program Files (x86)/GRASS GIS 7.1.svn/scripts/r.diversity.py", line 1
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    ^
SyntaxError: invalid syntax'
In addition: Warning message:
running command '"C:/Program Files (x86)/GRASS GIS 7.1.svn/extrabin/python.exe" "C:/Program Files (x86)/GRASS GIS 7.1.svn/scripts/"r.diversity.py --interface-description' had status 1 
Error in parseGRASS(cmd, legacyExec = legacyExec) : 
  r.diversity not parsed

Any ideas?

Thanks again
Sandra

-----Original Message-----
From: neteler.osgeo at gmail.com [mailto:neteler.osgeo at gmail.com] On Behalf Of Markus Neteler
Sent: 22 May 2014 08:53 AM
To: Glynn Clements
Cc: Sandra MacFadyen; GRASS user list; GRASS developers list
Subject: Re: [GRASS-dev] [GRASS-user] execGRASS("r.diversity"): [Error 3] Cannot find path specified \\.grass7\\r.li

On Wed, May 21, 2014 at 7:38 PM, Glynn Clements <glynn at gclements.plus.com> wrote:
>
> [CC to grass-dev]
>
> Sandra MacFadyen wrote:
>
>>   File "C:/Program Files (x86)/GRASS GIS 
>> 7.0.0beta2/scripts/r.diversity.py",
>> line 116, in main
>>     os.mkdir(rlidir)
>> WindowsError: [Error 3] The system cannot find the path specified:
>> 'D:/Bands_processed1\\.grass7\\r.li'
>
> r.diversity.py is broken on Windows:
>
>     home = os.path.expanduser('~')
>     rlidir = os.path.join(home, '.grass7', 'r.li')
>
> The script tries to create an r.li subdirectory, but fails because the 
> parent directory doesn't exist.
>
> $HOME/.grass7 is correct for Unix, but on Windows it's 
> %APPDATA%\GRASS7. From lib/init/grass.py:
>
>     # configuration directory
>     grass_env_file = None  # see check_shell()
>     if sys.platform == 'win32':
>         grass_config_dirname = "GRASS7"
>         grass_config_dir = os.path.join(os.getenv('APPDATA'), grass_config_dirname)
>     else:
>         grass_config_dirname = ".grass7"
>         grass_config_dir = os.path.join(os.getenv('HOME'), 
> grass_config_dirname)

I have added that in r60403.

Sandra, please try the updated version from Addons SVN.

Markus



More information about the grass-user mailing list