R 被打破 "dyld: Library not loaded: @rpath/libpcre.1.dylib"

R is broken with "dyld: Library not loaded: @rpath/libpcre.1.dylib"

我正在尝试关注 Brew doctor: dyld: Library not loaded & Error: No available formula for zlib,但没有帮助。我的 R 今天早些时候工作,但我通过 conda 安装了 r-essentials(我的 R 最初是如何安装的),现在出现以下错误:

$ which R
/Users/jespinoz/anaconda/bin/R

$ /Users/jespinoz/anaconda/bin/R
dyld: Library not loaded: @rpath/libpcre.1.dylib
  Referenced from: /Users/jespinoz/anaconda/lib/R/lib/libR.dylib
  Reason: image not found
Trace/BPT trap: 5

我最终删除了整个 anaconda 目录并重新安装:(

事后看来,我意识到我需要制作一个 shellscript 以防万一发生任何奇怪的事情,我需要重新安装所有东西。每次我安装一个我认为有用的新模块时,我就把它添加到这里。

这是我所有的 PythonR 包裹:

# Python
conda install xarray --yes
conda install holoviews --yes
conda install seaborn --yes
conda install scikit-learn --yes
conda install scikit-image --yes
conda install -c https://conda.anaconda.org/biocore scikit-bio --yes
conda install dill --yes
conda install pandas --yes
conda install numpy --yes
conda install networkx --yes
conda install scipy --yes
pip install fastcluster
conda install -c jjhelmus tensorflow=0.8.0rc0 --yes
conda install bokeh --yes
conda install BioPython --yes
conda install tqdm --yes
pip install git+https://github.com/pymc-devs/pymc3
conda install dask --yes
conda install numba --yes
pip install nbopen
pip install nbextensions
pip install https://github.com/ipython-contrib/IPython-notebook-extensions/tarball/master
conda install html5lib --yes
pip install selenium
conda install phantoms --yes
pip install pubchempy —yes
conda install --channel https://conda.anaconda.org/rdkit rdkit --yes
conda install --channel https://conda.anaconda.org/bioconda bioservices --yes
conda install --channel https://conda.anaconda.org/ales-erjavec orange-bioinformatics
pip install plotly
pip install ete3

# R
conda install -c r r --yes
conda install -c r r-essentials --yes
conda install -c r r-rserve --yes
conda install -c r r-devtools --yes
conda install -c r r-rcurl --yes
conda install -c r r-RJSONIO --yes
conda install -c r r-jpeg --yes
conda install -c r r-png --yes
conda install -c r r-roxygen2 --yes
conda install --channel https://conda.anaconda.org/bioconda bioconductor-edger --yes

文件 libpcre.1.dylib 不在@rpath

我从 /opt/local/lib/ 找到了 libpcre.1.dylib 并在我的例子中 link conda 放置 R 库的位置进行符号化

~/anaconda/lib/R/lib

如果你有类似的情况,这 2 个命令稍作修改应该可以帮助你

cd  /Users/you_username/anaconda/lib/R/lib

ln -s /opt/local/lib/libpcre.1.dylib libpcre.1.dylib

然后问题就解决了

我的猜测是当你的计算机上已经安装了 R 并且
r-essentials 稍后添加到 anaconda insatll 不要将 libpcre.1.dylib 添加到安装中,因为它已经存在。但是完成的时候没有更新@rpath.