[GRASS-user] Rscript error when using v.class.mlR

Micha Silver tsvibar at gmail.com
Sat Jul 15 05:17:17 PDT 2023


Hi Jamille


On 15/07/2023 2:04, Jamille Haarloo wrote:
> Dear all,
>
> What was the solution to this error? I recently got a similar error 
> from the same module v.class.mlR. I am using GRASS GIS 8.2.1  on 
> Windows 10.
>

The previous post was in reference to MacOS. Can you check on your 
system that the Rscript executable is available from the GRASS command 
window? i.e.

- start grass (even without the GUI)

- go to the command shell

- run Rscript -e "sessionInfo()"


This will identify if the problem is due to missing PATH in the env 
variables.



> Best,
> Jamille
>
> ----
> Running R now. Following output is R output.
> Traceback (most recent call last):
>   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
> pts\v.class.mlR.py <http://v.class.mlR.py>", line 977, in <module>
>     main()
>   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
> pts\v.class.mlR.py <http://v.class.mlR.py>", line 908, in main
>     subprocess.check_call(
>   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> 368, in check_call
>     retcode = call(*popenargs, **kwargs)
>   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> 349, in call
>     with Popen(*popenargs, **kwargs) as p:
>   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> 951, in __init__
>     self._execute_child(args, executable, preexec_fn,
> close_fds,
>   File "C:\OSGeo4W\apps\Python39\lib\subprocess.py", line
> 1420, in _execute_child
>     hp, ht, pid, tid = _winapi.CreateProcess(executable,
> args,
> FileNotFoundError: [WinError 2] The system cannot find the
> file specified
>
>
> On Sun, Feb 20, 2022 at 8:24 AM Nicklas Larsson via grass-user 
> <grass-user at lists.osgeo.org> wrote:
>
>     Daniel,
>
>     I assume you use the official GRASS app bundle for mac. If you are
>     not using the final 8.0.0 version, but one of the release
>     candidates, I'd suggest you download the latest. There are changes
>     in the startup script in the final version that relate to PATH
>     issues like this.
>
>
>
>     Best,
>     Nicklas
>
>
>
>
>
>
>
>     On Sunday, 20 February 2022, 01:55:28 CET, Daniel Kozar via
>     grass-user <grass-user at lists.osgeo.org> wrote:
>
>
>
>
>
>     Hi Micha,
>
>     Thanks for the reply. I ran the script lines you sent both in the
>     terminal as well as a GRASS session. Rscript is recognized in the
>     terminal command but not in the GRASS 8.0 command. Since GRASS 8.0
>     did not recognize Rscript I tried making a symbolic link for
>     "Rscript" to the full path: /usr/local/bin/Rscript. This still
>     doesn't recognize the command and I'm unsure how else to work
>     around it.
>
>     Any Mac aficionados reading this - do you have an idea to resolve
>     this?
>
>     Thanks
>     Daniel
>
>     On Sat, Feb 19, 2022 at 1:46 AM Micha Silver <tsvibar at gmail.com>
>     wrote:
>     > Hi
>     >
>     >
>     > On 19/02/2022 04:27, Daniel Kozar via grass-user wrote:
>     >> Hi everyone,
>     >>
>     >> When using the extension "v.class.mlR" I get an error [Message
>     1] (see
>     >> below) that "Rscript" cannot be located. I traced this back to the
>     >> script for "v.class.mlR" and edited line 908 to read the direct
>     path
>     >> to Rscript - '/usr/local/bin/Rscript' rather than 'Rscript' alone.
>     >> However, when I re-open GRASS 8.0 I get an error [Message 2]
>     that the
>     >> extension failed when loading and that the operation isn't
>     permitted.
>     >> I allowed for the application to have administrative rights but it
>     >> still doesn't work. Does anyone know how to work around this or
>     solve
>     >> the issue finding "Rscript"?
>     >>
>     >> I have R running and have installed necessary packages. I'm
>     >> running GRASS on MacOS Monterey.
>     >
>     >
>     > This looks like a Mac problem (which I know nothing about).
>     >
>     > To test, can you run, first from a terminal:
>     >
>     > micha at RMS:~$ Rscript -e "sessionInfo()"
>     >
>     > Now run the same from within a GRASS session:
>     >
>     > (here's what I get)
>     >
>     > micha at RMS:QGIS$ g.version
>     > GRASS 8.1.dev <http://8.1.dev> (2022)
>     >
>     > micha at RMS:QGIS$ Rscript -e "sessionInfo()"
>     > R version 4.1.2 (2021-11-01)
>     > Platform: x86_64-pc-linux-gnu (64-bit)
>     > Running under: Debian GNU/Linux 11 (bullseye)
>     >
>     > Matrix products: default
>     > BLAS:   /usr/lib/x86_64-linux-gnu/ openblas-pthread/libblas.so.3
>     > LAPACK: /usr/lib/x86_64-linux-gnu/
>     openblas-pthread/libopenblasp- r0.3.13.so <http://r0.3.13.so>
>     >
>     > locale:
>     >   [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
>     >   [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
>     >   [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8
>     >   [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C
>     >   [9] LC_ADDRESS=C               LC_TELEPHONE=C
>     > [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
>     >
>     > attached base packages:
>     > [1] stats     graphics  grDevices utils     datasets methods base
>     >
>     > loaded via a namespace (and not attached):
>     > [1] compiler_4.1.2
>     >
>     > If the Rscript executable is not found, then v.class.mlR cannot
>     be run.
>     >
>     >
>     >>
>     >> Any help would be appreciated.
>     >> - Daniel
>     >> ------------------------------ ------------------------------
>     -----------------
>     >> *[Message 1]*
>     >>
>     >> Running R now. Following output is R output.
>     >>
>     >> Traceback (most recent call last):
>     >>
>     >> File "/Users/dankozar/Library/ GRASS/8.0/Addons/scripts/v.
>     class.mlR",
>     >> line 977, in <module>
>     >>
>     >> main()
>     >>
>     >> File "/Users/dankozar/Library/ GRASS/8.0/Addons/scripts/v.
>     class.mlR",
>     >> line 908, in main
>     >>
>     >> subprocess.check_call(
>     >>
>     >> File
>     >> "/Applications/GRASS-8.0.app/ <http://GRASS-8.0.app/>
>     Contents/Resources/lib/ python3.9/subprocess.py",
>     >> line 368, in check_call
>     >>
>     >> retcode = call(*popenargs, **kwargs)
>     >>
>     >> File
>     >> "/Applications/GRASS-8.0.app/ <http://GRASS-8.0.app/>
>     Contents/Resources/lib/ python3.9/subprocess.py",
>     >> line 349, in call
>     >>
>     >> with Popen(*popenargs, **kwargs) as p:
>     >>
>     >> File
>     >> "/Applications/GRASS-8.0.app/ <http://GRASS-8.0.app/>
>     Contents/Resources/lib/ python3.9/subprocess.py",
>     >> line 951, in __init__
>     >>
>     >> self._execute_child(args, executable, preexec_fn, close_fds,
>     >>
>     >> File
>     >> "/Applications/GRASS-8.0.app/ <http://GRASS-8.0.app/>
>     Contents/Resources/lib/ python3.9/subprocess.py",
>     >> line 1821, in _execute_child
>     >>
>     >> raise child_exception_type(errno_ num, err_msg, err_filename)
>     >>
>     >> FileNotFoundError: [Errno 2] No such file or directory: 'Rscript'
>     >>
>     >>
>     >> *[Message 2]*
>     >>
>     >> Details: <[Errno 1] Operation not permitted: 'v.class.mlR'>
>     >>
>     >> WARNING: Some addons failed when loading. Please consider to
>     update
>     >> your addons by running 'g.extension.all -f'.
>     >>
>     >>
>     >> --
>     >> Thank you,
>     >>
>     >> Daniel Kozar
>     >> PhD Candidate
>     >> UC Davis - Hydrologic Sciences
>     >> djkozar at ucdavis.edu
>     >> (814) 380-6900
>     >>
>     >> ______________________________ _________________
>     >> grass-user mailing list
>     >> grass-user at lists.osgeo.org
>     >> https://lists.osgeo.org/ mailman/listinfo/grass-user
>     >
>     > --
>     > Micha Silver
>     > Ben Gurion Univ.
>     > Sde Boker, Remote Sensing Lab
>     > cell: +972-523-665918
>     >
>     >
>
>
>     -- 
>     Thank you,
>
>     Daniel Kozar
>     Graduate Student
>     UC Davis - Hydrologic Sciences
>     djkozar at ucdavis.edu
>     (814) 380-6900
>
>
>     -- 
>     Thank you,
>
>     Daniel Kozar
>     Graduate Student
>     UC Davis - Hydrologic Sciences
>     djkozar at ucdavis.edu
>     (814) 380-6900
>
>
>     _______________________________________________
>     grass-user mailing list
>     grass-user at lists.osgeo.org
>     https://lists.osgeo.org/mailman/listinfo/grass-user
>     _______________________________________________
>     grass-user mailing list
>     grass-user at lists.osgeo.org
>     https://lists.osgeo.org/mailman/listinfo/grass-user
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user

-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918



More information about the grass-user mailing list