[GRASS-user] Issue with addon r.vif in MS Windows GUI installations (stand-alone v. 7.2.2 and 7.0.5)

Helmut Kudrnovsky hellik at web.de
Thu Feb 1 03:04:17 PST 2018


Dinarzarde Raheem wrote
> I have been trying to run the addon r.vif using Grass for MS Windows
> standalone v. 7.2.2 and v. 7.0.5 on three separate PCs (two have Windows 7
> 32bit/64 bit, one runs Windows 10 Home 64 bit). I have been testing the
> r.vif installation using the example on the r.vif page of the Grass 7
> addons manual (i.e. this uses  the GRASS 7 Climatic data time series NC
> location nc_climate_spm_2000_2012).
> 
> With v. 7.2.2 (in both Windows 7 and 10) I can load the extension, and can
> visualise Addons in the search modules tab, but the r.vif. tool is not
> visible under Addons.
> 
> With v. 7.0.5  (in both Windows 7 and 10), I can load r. vif, visualise it
> under Addons in  the Search Modules tab and run it, but I get the
> following error message:
> 
> 
> (Wed Jan 31 15:06:21 2018)
> 
> r.vif
> maps=2011_01_precip at climate_1970_2012,2011_02_precip at climate_1970_2012,2011_03_precip at climate_1970_2012,2011_04_precip at climate_1970_2012,2011_05_precip at climate_1970_2012,2011_06_precip at climate_1970_2012,2011_07_precip at climate_1970_2012,2011_08_precip at climate_1970_2012,2011_09_precip at climate_1970_2012,2011_10_precip at climate_1970_2012,2011_11_precip at climate_1970_2012,2011_12_precip at climate_1970_2012
> maxvif=10 file=C:\grassworkspace\2011test
> 
> Reading in the data ...
> 
> Traceback (most recent call last):
> 
>   File "C:\Users\dinr\AppData\Roaming\GRASS7\addons/scripts/
> 
> r.vif.py", line 365, in 
> <module>
>     sys.exit(main(*gs.parser()))
> 
>   File "C:\Users\dinr\AppData\Roaming\GRASS7\addons/scripts/
> 
> r.vif.py", line 226, in main
> 
>     p = ReadData(IPF, n)
> 
>   File "C:\Users\dinr\AppData\Roaming\GRASS7\addons/scripts/
> 
> r.vif.py", line 156, in ReadData
> 
>     os.remove(tmpcov)
> 
> WindowsError: [Error 32] The process cannot access the file
> 
> because it is being used by another process:
> 
> 'c:\\users\\dinr\\appdata\\local\\temp\\tmpsggohd'
> 
> (Wed Jan 31 15:06:25 2018) Command finished (4 sec)
> 
> Is there anything I can do to fix this issue?

the reason for the error are these lines of code in the r.vif script:

<-------------
    [...]
155    # Clean up
156    os.remove(tmpcov)
-------------->

the temporary file tmpcov isn't closed, therefore the temporary file can't
be deleted.

just for testing I changed locally here in the script

<-------------
    [...]
155    # Clean up
156    # os.remove(tmpcov)
-------------->

now the script finishes with results.

the reason is that handling of temporary files in python is different in
linux and windows.

ping the script author (mentioned in [1]) and ask him to adapt the script
that it's also working in windows.



[1] https://grass.osgeo.org/grass74/manuals/addons/r.vif.html




-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html


More information about the grass-user mailing list