r - install.packages(...) 在 Windows 10 上失败
问题描述
我正在尝试dplyr
从 Visual Studio 2017 安装包。它依赖于pillar
.
当我从命令行执行安装时,我得到:
> install.packages('pillar')
Installing package into ‘C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
pillar 1.2.1 1.2.2 FALSE
installing the source package ‘pillar’
trying URL 'http://cran.r-project.org/src/contrib/pillar_1.2.2.tar.gz'
Content type 'application/x-gzip' length 64185 bytes (62 KB)
downloaded 62 KB
* installing *source* package 'pillar' ...
** package 'pillar' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Jirtme Verstrynge/Documents/R/win-library/3.3/pillar/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'pillar'
* removing 'C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.3/pillar'
Jérôme Verstrynge
into的虚假转换Jirtme Verstrynge
。
我该如何解决这个问题?
更多信息
当我从 Windows 10 PowerShell 执行 Get-WinSystemLocale 时,我得到:
LCID Name DisplayName
---- ---- -----------
2057 en-GB English (United Kingdom)
Sys.getlocale() 返回:
[1] "LC_COLLATE=English_United Kingdom.1252;
LC_CTYPE=English_United Kingdom.1252;
LC_MONETARY=English_United Kingdom.1252;
LC_NUMERIC=C;
LC_TIME=English_United Kingdom.1252"
解决方法
我已卸载 Microsoft R 客户端并从此处重新安装。客户端现在的版本为 3.4.3.0。
包支柱的问题已经消失,但它又回来了一个dendextend
在尝试时调用的包install.packages('seriation')
。
错误是:
> install.packages('seriation')
Installing package into ‘C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘dendextend’
There is a binary version available but the source version is later:
binary source needs_compilation
dendextend 1.7.0 1.8.0 FALSE
trying URL 'http://cran.r-project.org/bin/windows/contrib/3.4/seriation_1.2-3.zip'
Content type 'application/zip' length 1015954 bytes (992 KB)
downloaded 992 KB
package ‘seriation’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Temp\Rtmpi2lOd8\downloaded_packages
installing the source package ‘dendextend’
trying URL 'http://cran.r-project.org/src/contrib/dendextend_1.8.0.tar.gz'
Content type 'application/x-gzip' length 1758392 bytes (1.7 MB)
downloaded 1.7 MB
* installing *source* package 'dendextend' ...
** package 'dendextend' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Jirtme Verstrynge/Documents/R/win-library/3.4/dendextend/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'dendextend'
* removing 'C:/Users/Jérôme Verstrynge/Documents/R/win-library/3.4/dendextend'
In R CMD INSTALL
The downloaded source packages are in
‘C:\Temp\Rtmpi2lOd8\downloaded_packages’
Warning messages:
1: running command '"C:/PROGRA~1/MIE74D~1/RCLIEN~1/R_SERVER/bin/x64/R" CMD INSTALL -l "C:\Users\Jérôme Verstrynge\Documents\R\win-library\3.4" C:\Temp\Rtmpi2lOd8/downloaded_packages/dendextend_1.8.0.tar.gz' had status 1
2: In utils::install.packages(...) :
installation of package ‘dendextend’ had non-zero exit status
>
里面好像有问题utils::install.packages(...)
问题已解决
显然,除了重新安装 Microsoft R 客户端之外,剩下的问题与缺少 CRAN 存储库中尚不可用的二进制包有关。
解决方案
我怀疑这与支柱包有什么关系,但也许与这个包是从源代码安装的事实有关(不像从二进制安装的默认值)。这个问题最终会自行解决,因为您的 CRAN 镜像上可以使用 Pillar 1.2.2 的二进制版本(它已经在 CRAN 和https://cloud.r-project.org/web/packages/pillar/index.html上) )。
你的系统有什么价值getOption("repos")
?
在这种特殊情况下,非 ASCII 字符的错误编码感觉像是一个问题,最好通过为您的主目录选择一个纯 ASCII 和无空格的目录名称(例如C:\Users\jverstry
,而不是您当前的设置)来避免这种问题。要排除 Visual Studio 的问题,您可以尝试从 RGui 或 R 终端安装包,请仔细检查包的安装路径是否相同。
推荐阅读
- javascript - Angular:如何在传递给其他组件的 html 中获取价值?
- javascript - 创建具有所需树结构的对象
- php - 无法连接到服务器需要最新答案所有其他帖子都非常旧并且无法正常工作
- python - 使用函数来模拟类的方法返回值
- python - 如何以稳定的方式使用 pytest 断言列表?
- markdown - GitHub Markdown 中的表格和图像并排
- python - 使用python构建杂乱数据
- selenium - [Ashot][Selenium] - 为 iOS 和 Android 截屏
- python - 如果将 QThread 创建为局部变量,为什么 QThread 的行为会有所不同
- gatsby - netlify-cms git 提交未显示在网站上