Cannot install XML package in r

℡╲_俬逩灬. 提交于 2019-12-04 04:01:56

This worked for me in Mac OS X 10.11:

In the Terminal:

type xml2-config
xml2-config is /opt/local/bin/xml2-config

In R:

Sys.setenv(XML_CONFIG="/opt/local/bin/xml2-config")

Rather than forcing the linking of the libxml2 version from homebrew, you can edit the file $HOME/.R/Makevars to include:

CC=clang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk CXX=clang++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk

Edit the SDK version (i.e. MacOSX10.13 in above example) to match your installed version. See https://forums.developer.apple.com/thread/87829 for (minimal) explanation.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!