英文:
Trying to run Rscript from command line: Rscript command not found
问题
I am new to learning R and working in command line. I am attempting to run an R script from command line, however I am getting an error line.
bash: Rscript: command not found
I have searched for a couple hours, tried uninstalling & re-installing R, tried adding Rscript.exe to Path in 'system environment variables'...
When I run echo $PATH
I can confirm that the path is listed: C:/Program Files/R/R-4.3.0/bin/Rscript.exe
I am working from the same directory as the R script I am attempting to run.
For reference, I am running Windows 11, R 4.3.0, and using Git Bash.
I have found some similar questions on here, but none of the answers are working for me. I also am at a low level of knowledge on this topic and struggling to follow some suggestions.
Anyhow, if anyone is able to help me out I would super appreciate it! Happy to answer any questions with more details, I just don't know what I need to include.
英文:
I am new to learning R and working in command line. I am attempting to run an R script from command line, however I am getting an error line.
bash: Rscript: command not found
I have searched for a couple hours, tried uninstalling & re-installing R, tried adding Rscript.exe to Path in 'system environment variables'...
When I run echo $PATH
I can confirm that the path is listed: C:/Program Files/R/R-4.3.0/bin/Rscript.exe
I am working from the same directory as the R script I am attempting to run.
For reference, I am running Windows 11, R 4.3.0, and using Git Bash.
I have found some similar questions on here, but none of the answers are working for me. I also am at a low level of knowledge on this topic and struggling to follow some suggestions.
Anyhow, if anyone is able to help me out I would super appreciate it! Happy to answer any questions with more details, I just don't know what I need to include.
答案1
得分: 1
你的 $PATH 变量应该包含目录,而不是可执行文件。假设该命令位于 C:/Program Files/R/R-4.3.0/bin/Rscript.exe
,那么 echo $PATH
需要显示 C:/Program Files/R/R-4.3.0/bin
。
英文:
Your $PATH variable should contain the directory, not the executable. Assuming the command is at C:/Program Files/R/R-4.3.0/bin/Rscript.exe
, then echo $PATH
needs to show C:/Program Files/R/R-4.3.0/bin
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论