当我运行R
时,我得到:
dyld: Library not loaded: /usr/local/opt/openblas/lib/libopenblasp-r0.2.20.dylib
Referenced from: /usr/local/Cellar/r/3.5.0_1/lib/libR.dylib
Reason: image not found
Abort trap: 6
确实没有文件:
ls /usr/local/opt/openblas/lib/libopenblasp-r0.2.20.dylib
ls: cannot access '/usr/local/opt/openblas/lib/libopenblasp-r0.2.20.dylib': No such file or directory
我在macOS 10.13.3上使用homebrew安装R,如下所示:
# Java
brew cask install java
# OpenBLAS (installs gcc and other dependencies)
brew install openblas
# R language for statistical computing
brew install r --with-openblas --with-java
# Install XQuartz, needed for R package "Cairo"
brew cask install xquartz
# Needed for R package "RMySQL"
brew install mariadb-connector-c
# Needed for R packages: udunits2, units, ggforce
brew install udunits
答案 0 :(得分:5)
让我们看看openblas
的已安装版本是否为0.2.20:
brew info openblas
openblas: stable 0.3.0 (bottled), HEAD [keg-only]
Optimized BLAS library
https://www.openblas.net/
/usr/local/Cellar/openblas/0.3.0 (22 files, 139MB)
Poured from bottle on 2018-05-31 at 20:42:55
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openblas.rb
==> Dependencies
Required: gcc ✔
==> Options
--with-openmp
Enable parallel computations with OpenMP
--HEAD
Install HEAD version
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/openblas/lib
CPPFLAGS: -I/usr/local/opt/openblas/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/openblas/lib/pkgconfig
我们有0.3.0但R正在寻找0.2.20
要解决此问题,我们可以从已安装的dylib创建一个符号链接:
ln -s /usr/local/opt/openblas/lib/libopenblas.dylib \
/usr/local/opt/openblas/lib/libopenblasp-r0.2.20.dylib
有效!
R
R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.4.0 (64-bit)
答案 1 :(得分:5)
另一种解决方案是重新安装R:
brew reinstall r
这将重新链接R与正确的库,并且您将没有任何符号链接,这些符号链接可能会变得孤立或稍后导致问题。这不会影响您已经安装的任何R软件包。另外,如果您已经安装了带有Brew的R的最新版本,并且瓶子仍在计算机上,则无需再次下载瓶子。
答案 2 :(得分:0)
brew upgrade R
在大多数情况下将确保已安装要求:
==> Upgrading 1 outdated package:
r 3.5.3 -> 3.6.1
==> Upgrading r
==> Pouring r-3.6.1.mojave.bottle.tar.gz
? /usr/local/Cellar/r/3.6.1: 2,121 files, 56.6MB
Removing: /usr/local/Cellar/r/3.5.3... (2,118 files, 55.8MB)
答案 3 :(得分:0)
就我而言,运行 uninstall
和 reinstall
并没有解决问题。运行 brew doctor
后发现我有无衬里的小桶,包括 gcc
运行 brew link gcc
解决了这个问题。
答案 4 :(得分:-1)
我有一个类似的错误,首先是在Mac OSX 10.14上使用R 3.5.2_2的“ libopenblas”,然后是“ libgfortran”。
通过解决此问题:
brew upgrade R
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/cask and homebrew/bundle).
No changes to formulae.
==> Upgrading 1 outdated package:
r 3.5.2_2 -> 3.6.1
==> Upgrading r
==> Downloading https://homebrew.bintray.com/bottles/r-3.6.1.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/1e/1ed9fe16ae694fa3b35a7d979853447eb7b8aec1e804019a1bf4aafa299a6696?__gd
######################################################################## 100.0%
==> Pouring r-3.6.1.mojave.bottle.tar.gz
? /usr/local/Cellar/r/3.6.1: 2,121 files, 56.6MB
Removing: /usr/local/Cellar/r/3.4.1_2... (2,113 files, 55.2MB)
Removing: /usr/local/Cellar/r/3.5.1... (2,116 files, 55.6MB)
Removing: /usr/local/Cellar/r/3.5.2_2... (2,119 files, 56.0MB)
R在此之后可以完美工作:
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin18.6.0 (64-bit)