【问题标题】:install.packages(...) fails on Windows 10install.packages(...) 在 Windows 10 上失败
【发布时间】:2018-05-05 16:20:06
【问题描述】:

我正在尝试从 Visual Studio 2017 安装 dplyr 包。它依赖于 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 VerstryngeJirtme 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 客户端并从 here 重新安装它。客户端现在是 3.4.3.0 版本。

软件包支柱的问题已经消失,但在尝试 install.packages('seriation') 时,它又出现了一个名为 dendextend 的软件包。

错误是:

> 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 存储库上尚不可用的二进制包有关。

【问题讨论】:

  • 副手我猜你可能需要让你的 R 语言环境与你的 Windows 10 安装一致。见:?Sys.setlocale
  • @42- 我认为语言环境还可以(请参阅我在问题中的补充)
  • 如果您尝试编辑,则该编辑没有“坚持”。
  • 好的,重新,我已经重新发布了我的编辑@42-
  • 似乎 1252(Windows 特定功能)的代码页对您在 Visual Studio 环境中的 Jérôme 输入做了一些奇怪的事情。我认为将此问题归咎于 R 可能并不完全正确。

标签: r dplyr windows-10 installation-package


【解决方案1】:

我怀疑这与 pillar 包有什么关系,但可能与这个包是从源代码安装的事实有关(与从二进制安装的默认设置不同)。随着pillar 1.2.2 的二进制版本在您的 CRAN 镜像上可用(它已经在 CRAN 和 https://cloud.r-project.org/web/packages/pillar/index.html 上),这个问题最终会自行解决。

getOption("repos") 在您的系统上的值是多少?

在这种特殊情况下,非 ASCII 字符的错误编码感觉像是一个问题,最好通过为您的主目录选择一个纯 ASCII 且无空格的目录名称(例如,C:\Users\jverstry 而不是您当前的设置)来避免这种问题.要排除 Visual Studio 的问题,您可以尝试从 RGui 或 R 终端安装包,请仔细检查包的安装路径是否相同。

【讨论】:

  • 对于 R studio,我得到:package ‘pillar’ is not available (for R version 3.3.3)
  • 对于 RGui(在 Microsoft R Open 版本 3.4 上),安装工作正常...
  • 二进制包仅适用于 R 的两个最新版本:3.5(最近发布)和 3.4。您能否将您的 Visual Studio 设置至少升级到 R 3.4?
  • 这就是我所做的,它解决了这个问题。虽然我现在有一个名为 dendextend 的包。
  • dendextend 几天前已在 CRAN 上更新,R 3.4 的二进制文件尚未构建。应该会在几天内自动解决。
猜你喜欢
  • 1970-01-01
  • 2019-02-06
  • 1970-01-01
  • 1970-01-01
  • 2020-03-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多