简体   繁体   中英

R can't install devtools or git2r due to lack of zlib on macOS 10.12.3 and 10.12.5

I am trying to install two packages in R (3.3.2): devtools and git2r . They are depending on the existence of zlib . This comes with macOS Sierra (10.12.3) and it's version 1.2.8 by default. When I'm trying to install these packages I get the error below.

I've been trying a lot of things.

  • directly installing via CRAN in RStudio: no effect.
  • trying to locate zlib on macOS: can't find zlib .
  • installing via R CMD INSTALL git2r : no effect.

I notice someone has a similar issue posted on GitHub: https://github.com/ropensci/git2r/issues . There is no solution yet.

Does anyone here have an idea?

Thanks!

Sander

ERROR MESSAGE BELOW

configure error in "/private/tmp/RtmpP6HZFx/R.INSTALLe73412909267/git2r"

configure error


The zlib library that is required to build git2r was not found.

Please install:

zlib1g-dev (package on eg Debian and Ubuntu)

zlib-devel (package on eg Fedora, CentOS and RHEL)

and try again.

If the zlib library is installed on your system but the git2r configuration is unable to find it, you can specify the include and lib path to zlib with:

"R CMD INSTALL --configure-args='--with-zlib-include=INCLUDE_PATH --with-zlib-lib=LIB_PATH' git2r"


See "config.log" for more details

ERROR: configuration failed for package "git2r"

*removing "/usr/local/lib/R/3.3/site-library/git2r"

UPDATE: the same issue persists on macOS X 10.12.5 in combination with R 3.4.0 - the latter I need for DESeq2 .

Solution...Mmm. Not really . I simply uninstalled R and all the packages, and than I reinstalled everything again. I installed R and RStudio via homebrew , following the instructions here: https://rud.is/b/2015/10/22/installing-r-on-os-x-100-homebrew-edition/ .

Oddly enough: all issues disappeared.

UPDATE #1: this solution does not - obviously - work for the combination R 3.4.0 and macOS X 10.12.5. We need a solution for this issue.

UPDATE #2: I have discovered what I believe was the issue: a wrong path to the xcode command line tools.

sudo xcode-select --reset did the trick and now xcode-select -p points to /Library/Developer/CommandLineTools . And which xcode-select points to /usr/bin/xcode-select . Googling I discovered that it is not needed to install Xcode through the App Store as it states on http://railsapps.github.io/xcode-command-line-tools.html :

"On earlier versions of macOS, it was more difficult to install Xcode Command Line Tools. It required a huge download of the full Xcode package from the Mac App Store or registration as an Apple developer for a smaller Command Line Tools package. Mac OS X Mavericks made installation of Xcode Command Line Tools much simpler.".

i was having the same problem. i have a note 8(samsung). just go to GitHub and install zlib from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM