<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 1, 2018 at 12:04 PM, Helmut Kudrnovsky <span dir="ltr"><<a href="mailto:hellik@web.de" target="_blank">hellik@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dinarzarde Raheem wrote<br>
> I have been trying to run the addon r.vif using Grass for MS Windows<br>
> standalone v. 7.2.2 and v. 7.0.5 on three separate PCs (two have Windows 7<br>
> 32bit/64 bit, one runs Windows 10 Home 64 bit). I have been testing the<br>
> r.vif installation using the example on the r.vif page of the Grass 7<br>
> addons manual (i.e. this uses  the GRASS 7 Climatic data time series NC<br>
> location nc_climate_spm_2000_2012).<br>
><br>
> With v. 7.2.2 (in both Windows 7 and 10) I can load the extension, and can<br>
> visualise Addons in the search modules tab, but the r.vif. tool is not<br>
> visible under Addons.<br>
><br>
> With v. 7.0.5  (in both Windows 7 and 10), I can load r. vif, visualise it<br>
> under Addons in  the Search Modules tab and run it, but I get the<br>
> following error message:<br>
><br>
><br>
> (Wed Jan 31 15:06:21 2018)<br>
><br>
> r.vif<br>
> maps=2011_01_precip@climate_19<wbr>70_2012,2011_02_precip@climate<wbr>_1970_2012,2011_03_precip@<wbr>climate_1970_2012,2011_04_<wbr>precip@climate_1970_2012,2011_<wbr>05_precip@climate_1970_2012,<wbr>2011_06_precip@climate_1970_<wbr>2012,2011_07_precip@climate_<wbr>1970_2012,2011_08_precip@<wbr>climate_1970_2012,2011_09_<wbr>precip@climate_1970_2012,2011_<wbr>10_precip@climate_1970_2012,<wbr>2011_11_precip@climate_1970_<wbr>2012,2011_12_precip@climate_<wbr>1970_2012<br>
> maxvif=10 file=C:\grassworkspace\2011tes<wbr>t<br>
><br>
> Reading in the data ...<br>
><br>
> Traceback (most recent call last):<br>
><br>
>   File "C:\Users\dinr\AppData\Roaming<wbr>\GRASS7\addons/scripts/<br>
><br>
> <a href="http://r.vif.py" rel="noreferrer" target="_blank">r.vif.py</a>", line 365, in<br>
> <module><br>
>     sys.exit(main(*gs.parser()))<br>
><br>
>   File "C:\Users\dinr\AppData\Roaming<wbr>\GRASS7\addons/scripts/<br>
><br>
> <a href="http://r.vif.py" rel="noreferrer" target="_blank">r.vif.py</a>", line 226, in main<br>
><br>
>     p = ReadData(IPF, n)<br>
><br>
>   File "C:\Users\dinr\AppData\Roaming<wbr>\GRASS7\addons/scripts/<br>
><br>
> <a href="http://r.vif.py" rel="noreferrer" target="_blank">r.vif.py</a>", line 156, in ReadData<br>
><br>
>     os.remove(tmpcov)<br>
><br>
> WindowsError: [Error 32] The process cannot access the file<br>
><br>
> because it is being used by another process:<br>
><br>
> 'c:\\users\\dinr\\appdata\\loc<wbr>al\\temp\\tmpsggohd'<br>
><br>
> (Wed Jan 31 15:06:25 2018) Command finished (4 sec)<br>
><br>
> Is there anything I can do to fix this issue?<br>
<br>
the reason for the error are these lines of code in the r.vif script:<br>
<br>
<-------------<br>
    [...]<br>
155    # Clean up<br>
156    os.remove(tmpcov)<br>
--------------><br>
<br>
the temporary file tmpcov isn't closed, therefore the temporary file can't<br>
be deleted.<br>
<br>
just for testing I changed locally here in the script<br>
<br>
<-------------<br>
    [...]<br>
155    # Clean up<br>
156    # os.remove(tmpcov)<br>
--------------><br>
<br>
now the script finishes with results.<br>
<br>
the reason is that handling of temporary files in python is different in<br>
linux and windows.<br>
<br>
ping the script author (mentioned in [1]) and ask him to adapt the script<br>
that it's also working in windows.<br>
<br>
<br>
<br>
[1] <a href="https://grass.osgeo.org/grass74/manuals/addons/r.vif.html" rel="noreferrer" target="_blank">https://grass.osgeo.org/grass7<wbr>4/manuals/addons/r.vif.html</a><br>
<br>
<br>
<br></blockquote><div>Hi Dinarzard, I will have a look at it. Helmut, I see you commented out the line that removes the temporary file. Any idea how I can do that in such a way that it works on both Linux and Windows?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
-----<br>
best regards<br>
Helmut<br>
--<br>
Sent from: <a href="http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html" rel="noreferrer" target="_blank">http://osgeo-org.1560.x6.nabbl<wbr>e.com/Grass-Users-f3884509.<wbr>html</a><br>
______________________________<wbr>_________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/grass-user</a></blockquote></div><br></div></div>