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

2023-07-21 Thread Jürgen E . Fischer
Hi Jamille,

On Thu, 20. Jul 2023 at 17:03:24 -0300, Jamille Haarloo wrote:
> Thank you Helmut,
> R is not found:
> 'R' is not recognized as an internal or external command, operable program
> or batch file.
> Currently looking for information online about what to do.
> 
> I also installed the winGRASS 8.3 via/in OSGeo4W v2, but now there is also
> a problem with g.extension to add v.class.mlR. I tried it on my laptop and
> work computer. Same problem.

R and git are not included in OSGeo4W.  So you have to install them separately.
The rbatch files call that external R, but AFAIK there is no way yet in GRASS
to put the external git into GRASS path.  And the rbatch files are only in
GRASS path.  So you cannot run them from the OSGeo4W shell directly, but from
within GRASS (gui or text).

Jürgen

-- 
Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
Software Engineer   D-26506 Nordenhttps://www.norbit.de
QGIS release manager (PSC)  Germany IRC: jef on Libera|OFTC


signature.asc
Description: PGP signature
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-20 Thread Jamille Haarloo
Thank you Helmut,
R is not found:
'R' is not recognized as an internal or external command, operable program
or batch file.
Currently looking for information online about what to do.

I also installed the winGRASS 8.3 via/in OSGeo4W v2, but now there is also
a problem with g.extension to add v.class.mlR. I tried it on my laptop and
work computer. Same problem.


Exception in thread
Thread-14
:
Traceback (most recent call last):
  File "C:\OSGeo4W\apps\Python39\lib\threading.py", line
954, in _bootstrap_inner

self.run()
  File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\core\gthr
ead.py", line 154, in __run

self.__run_backup()
  File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\core\gthr
ead.py", line 117, in run

ret = vars()["callable"](*args, **kwds)
  File "C:\OSGeo4W\apps\grass\grass83\gui\wxpython\modules\e
xtensions.py", line 369, in Load

raise GException(_("Unable to load extensions. %s") % msg)
core.gcmd
.
GException
:
Unable to load extensions. Traceback (most recent call
last):
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 2855, in 
sys.exit(main())
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 2803, in main
xmlurl = resolve_xmlurl_prefix(original_url, source=source)
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 2492, in resolve_xmlurl_prefix
version_branch = get_version_branch(VERSION[0])
File "C:\OSGeo4W\apps\grass\grass83\scripts\g.extension.py",
line 507, in get_version_branch
branch = gs.Popen(
File "C:\OSGeo4W\apps\grass\grass83\etc\python\grass\script\
core.py", line 55, in __init__
raise OSError(_("Cannot find the executable
{0}").format(args[0]))
OSError: Cannot find the executable git



On Wed, Jul 19, 2023 at 3:02 PM Helmut Kudrnovsky  wrote:

> >I am using standalone winGRASS, but installed it with OSGeo4W because I
> also use QGIS.
>
> I don't understand this. How do you install standalone winGRASS with
> OSGeo4W? But that's another question.
>
> Jürgen re-packaged now winGRASS 8.3.0 in OSGeo4W version 2 including the
> Rbatch-files.
>
> have a look at
> https://github.com/ggrothendieck/batchfiles/blob/master/R.bat#L520 and
> following code lines.
>
> the relevant one is
> https://github.com/ggrothendieck/batchfiles/blob/master/R.bat#L532
>
> "echo   path - Add R_TOOLS, R_MIKTEX ^& R_PATH to path for this cmd line
> session (0)"
>
> just tried here in OSGeo4W version 2 with re-packaged winGRASS 8.3.0:
>
> * starting a GRASS session
> * typing into the windows console: R path => this adds temporarily the
> path to R to %PATH%
> * typing into the windows console: RScript -e "sessionInfo()" => outputs
> all necessary infos if R is correctly found (as Micha suggested)
>
> when temporarily the path to R is added to %PATH% within the winGRASS
> session, try v.class.mlR.
>
>
> Kind regards
> Helmut
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-19 Thread Helmut Kudrnovsky
>I am using standalone winGRASS, but installed it with OSGeo4W because I also 
>use QGIS.

I don't understand this. How do you install standalone winGRASS with OSGeo4W? 
But that's another question.

Jürgen re-packaged now winGRASS 8.3.0 in OSGeo4W version 2 including the 
Rbatch-files.

have a look at 
https://github.com/ggrothendieck/batchfiles/blob/master/R.bat#L520 and 
following code lines.

the relevant one is 
https://github.com/ggrothendieck/batchfiles/blob/master/R.bat#L532

"echo   path - Add R_TOOLS, R_MIKTEX ^& R_PATH to path for this cmd line 
session (0)"

just tried here in OSGeo4W version 2 with re-packaged winGRASS 8.3.0:

* starting a GRASS session
* typing into the windows console: R path => this adds temporarily the path to 
R to %PATH%
* typing into the windows console: RScript -e "sessionInfo()" => outputs all 
necessary infos if R is correctly found (as Micha suggested)

when temporarily the path to R is added to %PATH% within the winGRASS session, 
try v.class.mlR.
 

Kind regards
Helmut
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-18 Thread Jamille Haarloo
I am using standalone winGRASS, but installed it with OSGeo4W because I
also use QGIS.
I was using version 8.2.1, but went back to 7.8.5 and OSGeo4W v1.
With R4.3.1 getting other errors, and with R4.0 there was also trouble
finding the R script? (FileNotFoundError: [WinError 2] The system cannot
find the file specified.)
I checked the input text files. These don't have NA values.
I am doing a test classification with limited training-data.
---
*Msg when using R4.3.1*
Running R now. Following output is R output.
During startup - Warning messages:
1: Setting LC_COLLATE=en_US.cp1252 failed
2: Setting LC_CTYPE=en_US.cp1252 failed
3: Setting LC_MONETARY=en_US.cp1252 failed
4: Setting LC_TIME=en_US.cp1252 failed
Loading required package: ggplot2
Loading required package: lattice
Warning messages:
1: package 'caret' was built under R version 4.3.1
2: package 'ggplot2' was built under R version 4.3.1
Warning message:
package 'data.table' was built under R version 4.3.1
Something is wrong; all the Accuracy metric values are missing:
Accuracy   Kappa
 Min.   : NA   Min.   : NA
 1st Qu.: NA   1st Qu.: NA
 Median : NA   Median : NA
 Mean   :NaN   Mean   :NaN
 3rd Qu.: NA   3rd Qu.: NA
 Max.   : NA   Max.   : NA
 NA's   :4 NA's   :4
Error: Stopping
In addition: There were 33 warnings (use warnings() to see them)
Execution halted
ERROR: There was an error in the execution of the R script.
Please check the R output.

On Tue, Jul 18, 2023 at 3:43 PM Helmut Kudrnovsky  wrote:

> >>Is it best to go back to the previous versions for the meantime?
> >
> >yes, that would be an option.
> >
> >are you using OSGeo4W or standalone winGRASS?
> >
> >these R-batch-files are living also in the source:
> >
> >https://github.com/OSGeo/grass/tree/main/mswindows/external/rbatch
> >
> >and are integrated into extrabin-folder of the winGRASS standalone
> installer.
> >
> >could you try the standalone installer? which version are you using?
>
> see also discussion at:
>
> https://github.com/OSGeo/grass/discussions/3091
>
>
>
>
>
>
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-18 Thread Helmut Kudrnovsky
>>Is it best to go back to the previous versions for the meantime?
> 
>yes, that would be an option.
>
>are you using OSGeo4W or standalone winGRASS?
>
>these R-batch-files are living also in the source:
>
>https://github.com/OSGeo/grass/tree/main/mswindows/external/rbatch
>
>and are integrated into extrabin-folder of the winGRASS standalone installer.
>
>could you try the standalone installer? which version are you using?

see also discussion at:

https://github.com/OSGeo/grass/discussions/3091
 
 
 


 
 
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-18 Thread Helmut Kudrnovsky
>Is it best to go back to the previous versions for the meantime?
 
yes, that would be an option.

are you using OSGeo4W or standalone winGRASS?

these R-batch-files are living also in the source:

https://github.com/OSGeo/grass/tree/main/mswindows/external/rbatch

and are integrated into extrabin-folder of the winGRASS standalone installer.

could you try the standalone installer? which version are you using?

kind regards
Helmut
 
 
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-17 Thread Jamille Haarloo
Thank you Helmut.
Is it best to go back to the previous versions for the meantime?

On Mon, Jul 17, 2023 at 4:20 PM Helmut Kudrnovsky  wrote:

> >ok, I misunderstood. I'm getting a similar response.
> >C:\Users\haarlooj\Documents>Rscript -e "sessionInfo()"
> >'Rscript' is not recognized as an internal or external command,
> >operable program or batch file.
>
> the reason is that the Rbatch-files from OSGeo4W version 1 (
> https://download.osgeo.org/osgeo4w/v1/x86_64/release/rbatch/) are not yet
> included in OSGeo4W version 2 (compare
> https://download.osgeo.org/osgeo4w/v2/x86_64/release/).
>
> winGRASS 8 is based upon OSGeo4W version 2.
>
> kind regards
> Helmut
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-17 Thread Helmut Kudrnovsky
>ok, I misunderstood. I'm getting a similar response.
>C:\Users\haarlooj\Documents>Rscript -e "sessionInfo()"
>'Rscript' is not recognized as an internal or external command,
>operable program or batch file.

the reason is that the Rbatch-files from OSGeo4W version 1 
(https://download.osgeo.org/osgeo4w/v1/x86_64/release/rbatch/) are not yet 
included in OSGeo4W version 2 (compare 
https://download.osgeo.org/osgeo4w/v2/x86_64/release/).

winGRASS 8 is based upon OSGeo4W version 2.

kind regards
Helmut

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2023-07-17 Thread Jamille Haarloo
ok, I misunderstood. I'm getting a similar response.
C:\Users\haarlooj\Documents>Rscript -e "sessionInfo()"
'Rscript' is not recognized as an internal or external command,
operable program or batch file.

On Mon, Jul 17, 2023 at 11:07 AM Micha Silver  wrote:

>
> On 17/07/2023 16:56, Jamille Haarloo wrote:
>
> Thank you Micha,
>
> This was the msg following "C:\Users\haarlooj\Documents> sessionInfo()":
> 'sessionInfo' is not recognized as an internal or external command,
> operable program or batch file.
>
> What you need to try is:
>
>
> Rscript -e "sessionInfo()"
>
>
> The GRASS module v.class.mlR  needs to be able to "find" the Rscript
> executable in order to run.
>
>
> I looked for the location and found this as location of R:
> C:\Program Files\R\R-4.3.0\bin\x64
> Location for Rstudio:
> C:\Program Files\RStudio
>
> Is it correct that I need to change the paths? What is the best method?
>
> Best,
> Jamille
>
>
> On Sat, Jul 15, 2023 at 9:17 AM Micha Silver  wrote:
>
>> 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 ", line 977, in 
>> > main()
>> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
>> > pts\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
>> >  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  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 
>> > 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 

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

2023-07-17 Thread Micha Silver

  
  


On 17/07/2023 16:56, Jamille Haarloo
  wrote:


  
  Thank you Micha, 


This was the msg following "C:\Users\haarlooj\Documents>
  sessionInfo()": 
  'sessionInfo'
is not recognized as an internal or external command,
operable program or batch file.



  

What you need to try is:


Rscript -e "sessionInfo()"


The GRASS module v.class.mlR 
  needs to be able to "find" the Rscript executable in order to run.



  
I looked for the location and found this as location of R: 
  C:\Program Files\R\R-4.3.0\bin\x64

Location for Rstudio:
  C:\Program Files\RStudio



Is it correct that I need to change the paths? What is the
  best method?


Best,
Jamille


  
  
  
On Sat, Jul 15, 2023 at
  9:17 AM Micha Silver 
  wrote:

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
  ",
  line 977, in 
  >     main()
  >   File
  "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
  > pts\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 
  > 
  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 
  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.
  >
  >   

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

2023-07-17 Thread Jamille Haarloo
Thank you Micha,

This was the msg following "C:\Users\haarlooj\Documents> sessionInfo()":
'sessionInfo' is not recognized as an internal or external command,
operable program or batch file.

I looked for the location and found this as location of R:
C:\Program Files\R\R-4.3.0\bin\x64
Location for Rstudio:
C:\Program Files\RStudio

Is it correct that I need to change the paths? What is the best method?

Best,
Jamille


On Sat, Jul 15, 2023 at 9:17 AM Micha Silver  wrote:

> 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 ", line 977, in 
> > main()
> >   File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
> > pts\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
> >  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  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 
> > 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@RMS:~$ Rscript -e "sessionInfo()"
> > >
> > > Now run the same from within a GRASS session:
> > >
> > > (here's what I get)
> > >
> > > micha@RMS:QGIS$ g.version
> > > GRASS 8.1.dev  (2022)
> > >
> > > micha@RMS:QGIS$ Rscript -e "sessionInfo()"
> > > R version 4.1.2 (2021-11-01)
> > > Platform: x86_64-pc-linux-gnu (64-bit)
> > > 

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

2023-07-15 Thread Micha Silver

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 ", line 977, in 
    main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
pts\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 
 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  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 
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@RMS:~$ Rscript -e "sessionInfo()"
>
> Now run the same from within a GRASS session:
>
> (here's what I get)
>
> micha@RMS:QGIS$ g.version
> GRASS 8.1.dev  (2022)
>
> micha@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 
>
> 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

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

2023-07-14 Thread Jamille Haarloo
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.

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", line 977, in 
main()
  File "C:\Users\haarlooj\AppData\Roaming\GRASS8\addons\scri
pts\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@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@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  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@RMS:~$ Rscript -e "sessionInfo()"
> >
> > Now run the same from within a GRASS session:
> >
> > (here's what I get)
> >
> > micha@RMS:QGIS$ g.version
> > GRASS 8.1.dev (2022)
> >
> > micha@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
> >
> > locale:
> >   [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C
> >   [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
> >   [5] LC_MONETARY=en_GB.UTF-8LC_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 
> >>
> >> 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/ Contents/Resources/lib/
> python3.9/subprocess.py",
> >> line 368, in check_call
> >>
> >> retcode = 

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

2022-02-20 Thread Nicklas Larsson via grass-user
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 
 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  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@RMS:~$ Rscript -e "sessionInfo()"
> 
> Now run the same from within a GRASS session:
> 
> (here's what I get)
> 
> micha@RMS:QGIS$ g.version
> GRASS 8.1.dev (2022)
> 
> micha@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
> 
> 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 
>>
>> 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/ Contents/Resources/lib/ 
>> python3.9/subprocess.py", 
>> line 368, in check_call
>>
>> retcode = call(*popenargs, **kwargs)
>>
>> File 
>> "/Applications/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/ 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/ 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
>> djko...@ucdavis.edu
>> (814) 380-6900
>>
>> __ _
>> grass-user mailing list
>> grass-user@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
djko...@ucdavis.edu
(814) 380-6900


-- 

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

2022-02-19 Thread Daniel Kozar via grass-user
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  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@RMS:~$ Rscript -e "sessionInfo()"
>
> Now run the same from within a GRASS session:
>
> (here's what I get)
>
> micha@RMS:QGIS$ g.version
> GRASS 8.1.dev (2022)
>
> micha@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
>
> locale:
>   [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C
>   [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
>   [5] LC_MONETARY=en_GB.UTF-8LC_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 
> >
> > 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/Contents/Resources/lib/python3.9/subprocess.py",
>
> > line 368, in check_call
> >
> > retcode = call(*popenargs, **kwargs)
> >
> > File
> > "/Applications/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/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/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
> > djko...@ucdavis.edu
> > (814) 380-6900
> >
> > ___
> > grass-user mailing list
> > grass-user@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
djko...@ucdavis.edu
(814) 380-6900


-- 
Thank you,

Daniel Kozar
Graduate Student
UC Davis - Hydrologic Sciences
djko...@ucdavis.edu
(814) 380-6900
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2022-02-19 Thread Micha Silver

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@RMS:~$ Rscript -e "sessionInfo()"

Now run the same from within a GRASS session:

(here's what I get)

micha@RMS:QGIS$ g.version
GRASS 8.1.dev (2022)

micha@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

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 


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/Contents/Resources/lib/python3.9/subprocess.py", 
line 368, in check_call


retcode = call(*popenargs, **kwargs)

File 
"/Applications/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/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/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
djko...@ucdavis.edu
(814) 380-6900

___
grass-user mailing list
grass-user@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

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


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

2022-02-18 Thread Daniel Kozar via grass-user
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.

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 

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/Contents/Resources/lib/python3.9/subprocess.py",
line 368, in check_call

retcode = call(*popenargs, **kwargs)

  File
"/Applications/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/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/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
djko...@ucdavis.edu
(814) 380-6900
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user