微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

install_github(): "系统错误 267,目录名无效"

如何解决install_github(): "系统错误 267,目录名无效"

我正在尝试使用 performance 安装软件包 devtools 开发版本,但出现此错误

> devtools::install_github("easystats/performance")
Downloading GitHub repo easystats/performance@HEAD
Error: Failed to install 'performance' 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)

与替代 remotes 命令相同:

> remotes::install_github("easystats/performance")
Downloading GitHub repo easystats/performance@HEAD
Error: Failed to install 'performance' 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)

编辑:请注意,无论我尝试通过 devtools(例如,cardiomoon/processRr-lib/Crayon)安装什么软件包,我都会遇到相同的错误。这在几周前突然发生,但以前从未出现过这个问题。所以它似乎与包无关,而是与其他东西有关。

因此,我尝试将认库更改为有史以来最简单的位置,该位置没有任何特殊字符或需要任何管理员权限,使用这些 instructions。我可以确认 C:/Rpackages 现在确实是我的认库路径,并且它是第一个(在左侧):

> .libPaths()
[1] "C:/Rpackages"                      "C:/Program Files/R/R-4.0.3/library"

但是,我仍然遇到相同的错误。奇怪的是,错误似乎仍然指向第二个库路径而不是第一个,这在我看来是错误的。从帮助文档中,我没有看到如何为 devtoolsremotes 明确指定库位置。同样有趣的是,请注意错误似乎提到了 R-40~1.3 而不是 R-4.0.3,因为它应该(?)。这可能是问题吗?那么如何修复?

我也尝试重新安装 devtoolsremotes,但无济于事。

但是,如果我安装常规的 CRAN 版本,它就可以工作:

> install.packages("performance")
Installing package into ‘C:/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/performance_0.7.2.zip'
Content type 'application/zip' length 2487172 bytes (2.4 MB)
downloaded 2.4 MB

package ‘performance’ successfully unpacked and MD5 sums checked

如果有用,这里是我的会话信息:

> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252   
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C                   
[5] LC_TIME=English_Canada.1252    

attached base packages:
[1] stats     graphics  Grdevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.0.3 tools_4.0.3    yaml_2.2.1    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。