安装'tinytex'软件包时出现非零退出状态

3

我对此很陌生,如果我做错了什么或者漏掉了某个步骤,我非常抱歉!

我正在运行Windows 10企业版,我的公司允许我使用的R版本是:

R版本为3.5.1(2018-07-02)--“Feather Spray”
版权所有(C)2018年The R Foundation for Statistical Computing

平台:x86_64-w64-mingw32 / x64(64位)

运行结果的文本如下:

install.packages('tinytex')

also installing the dependency 'xfun'
  There are binary versions available but the source versions are later:
        binary source needs_compilation
xfun      0.13   0.20              TRUE
tinytex   0.22   0.28             FALSE

  Binaries will be installed
trying URL 'https://cran.ms.unimelb.edu.au/bin/windows/contrib/3.5/xfun_0.13.zip'
Content type 'application/zip' length 184719 bytes (180 KB)
downloaded 180 KB

package 'xfun' successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\p1311516\AppData\Local\Temp\Rtmpu0Onn4\downloaded_packages
installing the source package 'tinytex'

trying URL 'https://cran.ms.unimelb.edu.au/src/contrib/tinytex_0.28.tar.gz'
Content type 'application/octet-stream' length 27595 bytes (26 KB)
downloaded 26 KB

In R CMD INSTALL
* installing *source* package 'tinytex' ...
** package 'tinytex' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
Error in `loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :`
  namespace 'xfun' 0.13 is being loaded, but >= 0.19 is required
ERROR: lazy loading failed for package 'tinytex'
* removing 'C:/Program Files/R/R-3.5.1/library/tinytex'

The downloaded source packages are in
        'C:\Users\p1311516\AppData\Local\Temp\Rtmpu0Onn4\downloaded_packages'
Warning message:
In install.packages("tinytex") :
  installation of package 'tinytex' had non-zero exit status

日志显示xfun-0.13存在问题,您尝试使用install.packages("xfun")升级到最新版本了吗? - r2evans
如果你选择从源代码安装而不是二进制文件(当它询问你时),你将会安装正确版本的 xfun - Brigadeiro
1个回答

4
问题在于R正在尝试安装版本为0.13的二进制xfun,而tinytex包(版本0.22)需要0.19或更高版本的xfun。鉴于您使用的是旧版R(3.5.1),升级可能很困难。您可以尝试三件事情。首先,卸载任何已安装的xfuntinytex版本。从此页面下载并安装Rtools 35,然后从源代码安装软件包:
install.packages(c("xfun", "tinytex"), type = "source")

如果那样不起作用:您可以尝试从CRAN下载最新的Windows二进制压缩包(xfuntinytex),并从文件安装。
install.packages(file.choose(), repos = NULL)

这将启动一个文件选择对话框。但是,考虑到您的旧R版本,这很可能无法正常工作。

最后的选择是从CRAN时光机下载R 3.5.1的旧版本二进制文件。这里是xfuntinytex的直接链接。下载压缩的Windows二进制文件,并按照上述文件安装说明进行安装。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接