首页 > 解决方案 > 包“eRm”加载失败

问题描述

当尝试通过命令加载“eRm”包(在 macOS 10.14.6 上全新安装 R 版本 4.0.4 / R-Studio 1.3.959)时,library(eRm)我得到:

Error: package or namespace load failed for ‘eRm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):  no package called ‘mnormt’

我卸载了 eRm 并重新安装了所有依赖项。我也安装了软件包 mnormt:

There is a binary version available but the source version is later:
   binary source needs_compilation
mnormt  2.0.0  2.0.1              TRUE

但没有成功。我还能做些什么来解决这个问题?

编辑:

感谢用户@G5W 的提示,我意识到包 mnormt 没有正确编译:

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mnormt.so] Error 1
ERROR: compilation failed for package ‘mnormt’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mnormt’
Warning in install.packages :
installation of package ‘mnormt’ had non-zero exit status

解决方案:在 macOS 10.14.6 上,我必须按照此处所述安装编译器工具:https ://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/一切正常。非常感谢@G5W,您指出了正确的方向。

标签: rpackage

解决方案


推荐阅读