软件包“rmarkdown”的安装具有非零退出状态 - 如何解决这个问题?

问题描述 投票:0回答:3

我尝试在 RStudio 版本 1.4.904 和 R 版本 4.0.3 中安装“rmarkdown”,但出现以下错误。我无法打开新的 rmarkdown 并编织 rmarkdown 文件。每次我尝试时,都会弹出此消息,

 R Markdown documents requires an updated version of the rmarkdown package. Do you want to install this package now?

有人可以帮我吗?

安装.packages(ç,依赖项= TRUE)

Installing package into ‘/Users/Library/R/4.0/library’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
          binary source needs_compilation
rmarkdown    2.3    2.4             FALSE

installing the source package ‘rmarkdown’

trying URL 'http://cran.utstat.utoronto.ca/src/contrib/rmarkdown_2.4.tar.gz'
Content type 'application/x-gzip' length 3202546 bytes (3.1 MB)
==================================================
downloaded 3.1 MB

Warning in file(con, "r") :
  cannot open file '/var/db/timezone/zoneinfo/+VERSION': No such file or directory
dyld: lazy symbol binding failed: Symbol not found: _utimensat
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _utimensat
  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib (which was built for Mac OS X 10.13)
  Expected in: /usr/lib/libSystem.B.dylib

/Library/Frameworks/R.framework/Resources/bin/INSTALL: line 34: 30112 Done                    echo 'tools:::.install_packages()'
     30113 Abort trap: 6           | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --no-echo --args ${args}
Warning in install.packages :
  installation of package ‘rmarkdown’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/70/lgr12kdn6wn_k36sscnc0_dw0000gn/T/Rtmpmc0jUR/downloaded_packages’```
r r-markdown r-package
3个回答
0
投票

下载二进制 tgz (https://cran.r-project.org/web/packages/rmarkdown/index.html) 并直接从中安装。

应该可以。我有几乎同样的问题,我就是这样解决的。请随时通知我! F


0
投票

我也遇到了类似的问题,花了半天时间才得到正确的解决方案。

我遵循的步骤:

  1. 卸载现有版本

  2. 安装了 R 的更新版本 - R 版本 4.0.4 (2021-02-15).

  3. 单击“文件”->“新建文件”->“R markdown”。它要求安装 Rmarkdown 软件包。

  4. 记下我需要安装的软件包

  5. 在 R 源上输入 install.packages("rmarkdown", dependency = TRUE)(可以在 R 控制台上完成)

  6. 然后我尝试单独安装 Rmarkdown 软件包,它对我有用。以下是我需要安装的软件包。

    安装.packages('knitr') install.packages('tinytex') 安装.packages('base64enc') install.packages('摘要') 安装.packages('jsonlite') install.packages('htmltools') install.packages('rmarkdown')


0
投票

一种更具技术性的解决方法,但它对我有用。

  1. 转到 https://cran.r-project.org/ 从右侧菜单中选择“包”并导航,直到找到所需的包。
  2. 下载适合您的操作系统的binary.zip 文件并解压文件。
  3. 将解压的文件夹复制到软件包的安装目录中。它应该显示在您最初尝试安装软件包的错误消息中的某个位置。替换任何现有文件。重新启动 RStudio 以识别更新的版本。
© www.soinside.com 2019 - 2024. All rights reserved.