XiaO

R 包 ggalt 无法加载

XiaO / 2021-05-11


问题:R 包 ggalt 无法加载

R 包 ggalt 无法加载,提示找不到 ash 包的镜像。

> library(ggalt)
Error: package or namespace load failed for ‘ggalt’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '~/Rpackages/ash/libs/ash.so':
  dlopen(~/Rpackages/ash/libs/ash.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/10/libgfortran.5.dylib
  Referenced from: ~/Rpackages/ash/libs/ash.so
  Reason: image not found

尝试:重新安装 ggalt

尝试重新安装 ggalt,依旧提示找不到 ash 包的镜像。

> install.packages("ggalt", dependencies = T)
Installing package into ‘~/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.lzu.edu.cn/CRAN/src/contrib/ggalt_0.4.0.tar.gz'
Content type 'application/octet-stream' length 2155519 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

* installing *source* package ‘ggalt’ ...
** package ‘ggalt’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '~/Rpackages/ash/libs/ash.so':
  dlopen(~/Rpackages/ash/libs/ash.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/10/libgfortran.5.dylib
  Referenced from: ~/Rpackages/ash/libs/ash.so
  Reason: image not found
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘ggalt’
* removing ‘~/Rpackages/ggalt’
* restoring previous ‘~/Rpackages/ggalt’
Warning in install.packages :
  installation of package ‘ggalt’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/ws/s7w2_p5j4r162xr_hrn_3tm00000gn/T/RtmpWdDpHo/downloaded_packages’

尝试:重新安装 ash

> install.packages("ash")
Installing package into ‘~/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.lzu.edu.cn/CRAN/src/contrib/ash_1.0-15.tar.gz'
Content type 'application/octet-stream' length 7043 bytes
==================================================
downloaded 7043 bytes

* installing *source* package ‘ash’ ...
** package ‘ash’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fPIC  -g -O2  -c ash.f -o ash.o
gfortran -fno-optimize-sibling-calls  -fPIC  -g -O2  -c sort.f -o sort.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/4.0.5_1/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/xz/lib -L/usr/local/lib -o ash.so ash.o sort.o -L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin19/11.1.0 -L/usr/local/opt/gcc/lib/gcc/11 -lgfortran -lquadmath -lm -L/usr/local/Cellar/r/4.0.5_1/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing to ~/Rpackages/00LOCK-ash/00new/ash/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ash)

The downloaded source packages are in
    ‘/private/var/folders/ws/s7w2_p5j4r162xr_hrn_3tm00000gn/T/RtmpWdDpHo/downloaded_packages’

尝试:重新安装 ggalt

> install.packages("ggalt", dependencies = T)
Installing package into ‘~/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.lzu.edu.cn/CRAN/src/contrib/ggalt_0.4.0.tar.gz'
Content type 'application/octet-stream' length 2155519 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

* installing *source* package ‘ggalt’ ...
** package ‘ggalt’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '~/Rpackages/ash/libs/ash.so':
  dlopen(~/Rpackages/ash/libs/ash.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/10/libgfortran.5.dylib
  Referenced from: ~/Rpackages/ash/libs/ash.so
  Reason: image not found
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘ggalt’
* removing ‘~/Rpackages/ggalt’
* restoring previous ‘~/Rpackages/ggalt’
Warning in install.packages :
  installation of package ‘ggalt’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/ws/s7w2_p5j4r162xr_hrn_3tm00000gn/T/RtmpWdDpHo/downloaded_packages’
> install.packages("ash")
Installing package into ‘~/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.lzu.edu.cn/CRAN/src/contrib/ash_1.0-15.tar.gz'
Content type 'application/octet-stream' length 7043 bytes
==================================================
downloaded 7043 bytes

* installing *source* package ‘ash’ ...
** package ‘ash’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gfortran -fno-optimize-sibling-calls  -fPIC  -g -O2  -c ash.f -o ash.o
gfortran -fno-optimize-sibling-calls  -fPIC  -g -O2  -c sort.f -o sort.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/Cellar/r/4.0.5_1/lib/R/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/xz/lib -L/usr/local/lib -o ash.so ash.o sort.o -L/usr/local/opt/gcc/lib/gcc/11/gcc/x86_64-apple-darwin19/11.1.0 -L/usr/local/opt/gcc/lib/gcc/11 -lgfortran -lquadmath -lm -L/usr/local/Cellar/r/4.0.5_1/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
installing to ~/Rpackages/00LOCK-ash/00new/ash/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ash)

The downloaded source packages are in
    ‘/private/var/folders/ws/s7w2_p5j4r162xr_hrn_3tm00000gn/T/RtmpWdDpHo/downloaded_packages’
> install.packages("ggalt", dependencies = T)
Installing package into ‘~/Rpackages’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.lzu.edu.cn/CRAN/src/contrib/ggalt_0.4.0.tar.gz'
Content type 'application/octet-stream' length 2155519 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

* installing *source* package ‘ggalt’ ...
** package ‘ggalt’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggalt)

The downloaded source packages are in
    ‘/private/var/folders/ws/s7w2_p5j4r162xr_hrn_3tm00000gn/T/RtmpWdDpHo/downloaded_packages’

小结

install.packages("ash")
install.packages("ggalt", dependencies = T)