我正在尝试用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/processR或r-lib/crayon__),我都会收到相同的错误。这是几个星期前突然发生的事,但以前从未发生过这个问题。因此,这似乎与一揽子计划无关,而与其他一些东西有关。
因此,我尝试用这些使用说明将我的默认库更改为最简单的、没有任何特殊字符或需要任何管理权限的位置。我可以确认C:/Rpackages现在确实是我的默认库路径,并且它是第一个(左边):
> .libPaths()
[1] "C:/Rpackages" "C:/Program Files/R/R-4.0.3/library"然而,我仍然收到同样的错误。奇怪的是,这个错误似乎仍然指的是第二个库路径,而不是第一个库路径,这在我看来是错的。从帮助文档中,我看不到如何显式地为devtools和remotes指定库位置。同样有趣的是,注意错误似乎提到了R-40~1.3而不是R-4.0.3,因为它应该(?)。这可能是问题所在吗?那怎么解决呢?
我还试着重新安装devtools和remotes,但没有结果。
但是,如果我安装普通的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 发布于 2022-03-26 20:02:42
问题在于processx包,而开发版本已经收到了修复(在v3.5.3版本中)。有关更多信息,请参见以下讨论:https://github.com/r-lib/processx/issues/313
https://stackoverflow.com/questions/67874572
复制相似问题