无法安装包XML - 升级到R 3.3后问题与libxml2库有关

时间:2016-06-23 18:58:30

标签: r macos libxml2

尝试安装XML时出现以下错误:

** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'XML', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/usr/local/lib/R/3.3/site-library/XML/libs/XML.so':
  dlopen(/usr/local/lib/R/3.3/site-library/XML/libs/XML.so, 6): Library not loaded: @rpath/libz.1.dylib
  Referenced from: /usr/local/lib/R/3.3/site-library/XML/libs/XML.so
  Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/local/lib/R/3.3/site-library/XML’

我阅读了指南here(适用于xml2而不是XML),它有同样的问题,但解决方案对我不起作用。我下载了软件包,并尝试使用以下命令安装它:

R CMD INSTALL --configure-vars='INCLUDE_DIR=/usr/include/ LIB_DIR=/usr/lib' .

但我仍然得到同样的错误。

由于我愚蠢地安装了anaconda和homebrew,我总共安装了3个版本的libxml:

Ians-MacBook-Pro Thu Jun 23 11:54 10.10 $which xml2-config
xml2-config is /Users/ifiddes/anaconda/bin/xml2-config
xml2-config is /usr/local/bin/xml2-config
xml2-config is /usr/bin/xml2-config

我尝试使用所有3个版本的libxml2运行上面的install命令。所有编译,但以相同的方式在加载步骤失败。

我似乎在libz.1.dylib

上有/usr/lib的副本
Ians-MacBook-Pro Thu Jun 23 14:21 ~ $ls /usr/lib/libz*dylib
-rwxr-xr-x  1 root  wheel   174K May  4 23:15 /usr/lib/libz.1.dylib
lrwxr-xr-x  1 root  wheel    12B Jun 23 11:27 /usr/lib/libz.dylib -> libz.1.dylib
lrwxr-xr-x  1 root  wheel    12B Jun 23 11:27 /usr/lib/libz.1.2.5.dylib -> libz.1.dylib
lrwxr-xr-x  1 root  wheel    12B Jun 23 11:27 /usr/lib/libz.1.1.3.dylib -> libz.1.dylib

以下是Sys.getenv()的输出:

> Sys.getenv()
__CF_USER_TEXT_ENCODING
                        0x1F5:0x0:0x0
Apple_PubSub_Socket_Render
                        /private/tmp/com.apple.launchd.hmbX5Ty62C/Render
CLICOLOR                1
COLORFGBG               7;0
COLUMNS                 100
DISPLAY                 /private/tmp/com.apple.launchd.v48pxvb3MZ/org.macosforge.xquartz:0
DYLD_FALLBACK_LIBRARY_PATH
                        /usr/local/Cellar/r/3.3.1/R.framework/Resources/lib:/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/lib/server
EDITOR                  vi
HISTFILE                /Users/ifiddes/.eternal_bash_history
HISTFILESIZE
HISTSIZE
HISTTIMEFORMAT          [%D %T]
HOME                    /Users/ifiddes
ITERM_PROFILE           Default
ITERM_SESSION_ID        w3t0p1:E8AA203F-887F-457B-94AF-10956110B2BD
LANG                    en_US.UTF-8
LINES                   25
LN_S                    ln -s
LOGNAME                 ifiddes
LSCOLORS                ExFxBxDxCxegedabagacad
MAKE                    make
PAGER                   /usr/bin/less
PATH                    /Users/ifiddes/perl5/bin:/Users/ifiddes/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
PERL_LOCAL_LIB_ROOT     /Users/ifiddes/perl5
PERL_MB_OPT             --install_base "/Users/ifiddes/perl5"
PERL_MM_OPT             INSTALL_BASE=/Users/ifiddes/perl5
PERL5LIB                /Users/ifiddes/perl5/lib/perl5
PWD                     /Users/ifiddes
PYTHONSTARTUP           /Users/ifiddes/.pythonstartup
R_ARCH
R_BROWSER               /usr/bin/open
R_BZIPCMD               /usr/bin/bzip2
R_DOC_DIR               /usr/local/Cellar/r/3.3.1/R.framework/Resources/doc
R_GZIPCMD               /usr/bin/gzip
R_HOME                  /usr/local/Cellar/r/3.3.1/R.framework/Resources
R_INCLUDE_DIR           /usr/local/Cellar/r/3.3.1/R.framework/Resources/include
R_LIBS_SITE
R_LIBS_USER             ~/Library/R/3.3/library
R_PAPERSIZE             a4
R_PDFVIEWER             /usr/bin/open
R_PLATFORM              x86_64-apple-darwin15.5.0
R_PRINTCMD              lpr
R_RD4PDF                times,inconsolata,hyper
R_SESSION_TMPDIR        /var/folders/mb/7j7j53614qb36bp2qwfcr8dr0000gn/T//RtmpH5QKZH
R_SHARE_DIR             /usr/local/Cellar/r/3.3.1/R.framework/Resources/share
R_SYSTEM_ABI            osx,gcc,gxx,gfortran,?
R_TEXI2DVICMD           /usr/local/opt/texinfo/bin/texi2dvi
R_UNZIPCMD              /usr/bin/unzip
R_ZIPCMD                /usr/bin/zip
SED                     /usr/local/Library/ENV/4.3/sed
SHELL                   /bin/bash
SHLVL                   1
SSH_AUTH_SOCK           /private/tmp/com.apple.launchd.UH9wqQZqMU/Listeners
TAR                     /usr/bin/tar
TERM                    xterm-256color
TERM_PROGRAM            iTerm.app
TERM_PROGRAM_VERSION    3.0.0
TERM_SESSION_ID         w3t0p1:E8AA203F-887F-457B-94AF-10956110B2BD
TMPDIR                  /var/folders/mb/7j7j53614qb36bp2qwfcr8dr0000gn/T/
USER                    ifiddes
XPC_FLAGS               0x0
XPC_SERVICE_NAME        0

0 个答案:

没有答案