This repository has been archived by the owner on Oct 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Alternative way to add rtools to PATH through .Renviron #26
Comments
Hi thanks for your report. It looks like the What do you see in R: Sys.getenv("RTOOLS40_HOME") |
Hi,
this results in "". I think the account name is indeed the problem, but it
is hard or impossible to circumvent in my case due to the draconic way
administrator privileges are handled on my employers network. Possibly this
prevented the rtools installer from making the required changes even as I
ran it with administrator privileges. With more effort I might find a way
around it, but other people might also face this issue due to reasons out
of their control, without being aware like I was, and lose a lot of time
trying to figure it out.
Best regards,
Sam
…On Sun, 28 Feb 2021 at 23:26, Jeroen Ooms ***@***.***> wrote:
Hi thanks for your report. It looks like the RTOOLS40_HOME is not
available, it should be set by the rtools40 installer. Did you install it
under a different account name maybe?
What do you see in R:
Sys.getenv("RTOOLS40_HOME")
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#26 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJF5HNIYWVBHE4CI23OKRYDTBK7K5ANCNFSM4YIRDYBA>
.
|
Can confirm having the same issue.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I tried to install this on a home and work pc (both windows 10 64bit) using the instruction provided at https://cran.r-project.org/bin/windows/Rtools/. In both cases I simply installed rtools40 in the default directory c:/rtools40. While setting the PATH then worked like a charm on the former pc, I had a lot of trouble on my work pc. I managed to find a solution but adding a comment to suggest this alternative might save some other people time.
For the latter pc creating an .Renviron file running the suggested code below, then reloading rstudio and rended up adding "\usr\bin" instead of "c:\rtools40\usr\bin":
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
The same happened when trying to append the rtools40 path at the end of PATH by running
writeLines('PATH="${PATH};${RTOOLS40_HOME}\\usr\\bin"', con = "~/.Renviron")
I checked the makeconf file of the R installation ,and the RTOOLS40_HOME variable was correctly set to c:/rtools40. For some reason Rstudio(?) was not able to extract this information however. In the end, I solved the problem by manually entering the directory I installed rtools40 to using the code below, this might be a good suggestion for people having trouble:
writeLines('PATH="${PATH};C:\\rtools40\\usr\\bin"', con = "~/.Renviron")
Note: for some reason, trying to use the last snippet but adding the rtools40 path before the existing path caused the whole PATH variable to become corrupt:
#DONOTRUN writeLines('PATH="C:\\rtools40\\usr\\bin;PATH="${PATH}"', con = "~/.Renviron")
The text was updated successfully, but these errors were encountered: