尝试从命令行运行 Rscript: 未找到 Rscript 命令

huangapple go评论123阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月25日 03:41:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/76326910.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定