错误:dyn.load(file, DLLpath = DLLpath, ...) 中的“gmm”的包或命名空间加载失败:无法加载共享对象

pom*_*mus 3 r

我已将 R 版本上传到 4.0.2 (2020-06-22)。\n安装 gmm 包后,当我需要它时,我收到以下消息。我还为其他软件包(例如 TropFishR)采纳了此消息。我有 Xcode 10.3 。我重新安装了R studio和R几次。非常感谢您的宝贵时间。

\n

错误信息:

\n
Error: package or namespace load failed for \xe2\x80\x98gmm\xe2\x80\x99 in dyn.load(file, DLLpath = DLLpath, ...):\n unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/libs/gmm.so':\n  dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/libs/gmm.so, 6): Library not loaded: /usr/local/gfortran/lib/libgomp.1.dylib\n  Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/gmm/libs/gmm.so\n  Reason: image not found\n\n\nsession info:\n\n version 4.0.2 (2020-06-22)\nPlatform: x86_64-apple-darwin17.0 (64-bit)\nRunning under: macOS Mojave 10.14.6\n\nMatrix products: default\nBLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib\nLAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib\n\nlocale:\n[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8\n\nattached base packages:\n[1] stats     graphics  grDevices utils    \n[5] datasets  methods   base     \n\nother attached packages:\n[1] sandwich_2.5-1\n\nloaded via a namespace (and not attached):\n[1] zoo_1.8-8       compiler_4.0.2 \n[3] tools_4.0.2     grid_4.0.2     \n[5] lattice_0.20-41\n
Run Code Online (Sandbox Code Playgroud)\n

小智 9

问题的产生是因为Library not loaded: /usr/local/gfortran/lib/libgomp.1.dylib错过了。

为了解决这个问题,我访问了这个Github 发布页面,下载gfortran-10.2-Catalina.dmg并安装了它。然后我终于可以gmm在 R 中加载包了。