0
votes

Hello and thank you for your time.
I get the error:

cl <- parallel::makeCluster(2)
Rscript execution error: No such file or directory

whenever I try to make a cluster using the package "parallel". Other commands such as detectCores() work, but makeCluster() fails. I have reinstalled R and Rstudio, and I do not think the problem is with the installation.

R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS

Any help would be appreciated.

UPDATE:
If I run Rscript in the terminal, I get a similar error, but if I use sudo Rscript the error goes away. For example: Rscript helloworld.r gives me the error Rscript execution error: No such file or directory, but sudo Rscript helloworld.r works. (helloworld.r is an R script that prints hello world.)

Thanks in advance.

1
I suspect you have something funny going on in your shell startup script, e.g. ~/.bashrc. Try troubleshooting with cl <- future::makeClusterPSOCK(2, verbose = TRUE). It works very similar to parallel::makeCluster() but gives more detailed output. The returned cluster is also 100% compatible with what parallel returns.HenrikB
I would also try in a plain R session, e.g. R in the terminal. That way you can rule out RStudio.HenrikB
I did try R in the terminal, and not using RStudio, and the error is persistent. I have updated the question. I noted Rscript works as a "sudo" command, and I am not sure why it is the case and how I can fix it.NewLearner
So, if I understand you correctly, it has nothing todo with the parallel package, and the problem is that you cannot run a simple Rscript helloworld.r without using sudo? If so, wow, you got some that messes with your R setup. Does Rscript --version work? What about Rscript -e 1+2? Try also Rscript --vanilla helloworld.r.HenrikB
You got me Right! and it is messed up! I do not know how the problem has got there, as it stopped working by sudden. I have been reinstalling everything!! Rscript --version R scripting front-end version 3.6.2 (2019-12-12) but the rest of the commands do not work!NewLearner

1 Answers

1
votes

I use R with version 3.6.1enter image description here

Try to downgrade the r version