如何修复 Macos 的 R CMD 检查中的 tcltk 错误

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

我在 Mac OS 的 Github Action R CMD 检查中收到以下错误。其他操作系统没有错误。奇怪的是,我的包根本没有使用tcltk。我不知道如何修复包以避免这个问题,并且 CRAN 不会让我上传这个问题。

── Install failure ───────────────────────────────────────────────────────────── * installing *source* package ‘weird’ ... ** using staged installation ** R ** data *** moving datasets to lazyload DB ** inst ** byte-compile and prepare package for lazy loading tcltk DLL is linked to '/opt/X11/lib/libX11.6.dylib' Error: Error: .onLoad failed in loadNamespace() for 'tcltk', details: call: fun(libname, pkgname) error: X11 library is missing: install XQuartz from www.xquartz.org Execution halted ERROR: lazy loading failed for package ‘weird’ * removing ‘/Users/runner/work/weird-package/weird-package/check/weird.Rcheck/weird’ 1 error ✖ | 0 warnings ✔ | 0 notes ✔ Error: Process completed with exit code 1.
我知道我可以通过添加来解决 Github Action 上的问题

- name: Install XQuartz on macOS if: runner.os == 'macOS' run: brew install xquartz --cask
到 yaml,但这只能避免 Github 上的问题。当我提交到CRAN时问题仍然存在。

r github-actions cran tcltk
1个回答
0
投票
记录一下,以防万一有人遇到同样的问题。

事实证明,CRAN macos 机器缺少 Tcl/Tk 库,任何需要它们的包都会导致错误。所以问题是 CRAN 的,不是我的。

Github 操作修复只是将 xquartz 添加到 yaml 中:

- name: Install XQuartz on macOS if: runner.os == 'macOS' run: brew install xquartz --cask
    
© www.soinside.com 2019 - 2024. All rights reserved.