Error: "Windows can't find 'C:/PROGRA~1/'. Check the spelling and try again."
Asked Answered
W

1

1

I am getting an error in R in Windows 10 about finding a directory while trying to install a package from GitHub*. Trying to troubleshoot this error led me to a few observations.

For example, both Windows Explorer and my browser can find C:/PROGRA~1, but only my browser can find C:/PROGRA~1/R, where R is installed. The specific Windows Explorer error is:

Windows can't find 'C:/PROGRA~1/R'. Check the spelling and try again.

Yet, Windows Explorer can find C:/Program Files/R no problem. And the error above is the same with C:/PROGRA~1/Adobe, C:/PROGRA~1/Google, or any other. Even more interesting, Windows Explorer can't even find the raw program files path as long as we add a simple slash at the end! So C:/PROGRA~1/ will output a similar error.

So can anyone explain to me why Windows Explorer is not able to find C:/PROGRA~1/R or C:/PROGRA~1/? Is this normal/expected? If I solve this, I can probably resolve my R error too. Thanks.

*Here is the full original error in R:

Error: Failed to install 'package' from GitHub:
  create process 'C:/PROGRA~1/R/R-40~1.3/bin/x64/Rcmd.exe' (system error 267, The directory name is invalid.
) @win/processx.c:1040 (processx_exec)

Edit: My investigation revealed that it might be related to the direction of slashes... So for instance, C:/PROGRA~1\R (or even C:/PROGRA~1\) works in Windows Explorer, but only as long as the second slash is a backslash... Can this be of any help in resolving this issue? Doesn't seem like R wants to put that second slash as backslash...

Edit 2: My answer below was deleted so here it is again:

The issue was with the processx package and the development version has since received a fix (in version v3.5.3). Please see the following discussion for more info: https://github.com/r-lib/processx/issues/313

Wiltonwiltsey answered 14/6, 2021 at 18:15 Comment(1)
I just now found your question. I had the exactly same error, and created a bug report on GitHub of processx. Meanwhile there is a workaround for people trying to solve this. Check out this question on SOCampestral
H
0

For me the issue was that I had both, %OneDrive% and %OneDriveCommercial% env variables pointing to the same company onedrive folder, which I suspect to have caused a confusion! I deleted the %OneDrive%, and revised all the other envs to make sure that it is not referenced anywhere else.

Hazaki answered 18/3 at 10:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.