Install R and Python via Homebrew

(This article was first published on Pachá (Batteries Included), and kindly contributed to R-bloggers)

Original posted on 2017-01-08
Updated posted on 2017-07-12

Why should you do this?

With a single brew upgrade you can save yourself a headache and valuable time when you need newer software versions.

Besides that, R binaries from CRAN and OS X stock Python can give problems with different libraries.

Here are some examples of unexpected situations of the mentioned versions:

  1. I built my blog with Pelican. To use Pelican you need to run pip install pelican but that library figured as “not installed” after running that command on a fresh OS X installation.

  2. Some R packages will not work properly. For example, data.table shows this message when its loaded after running install.packages("data.table"):

This installation of data. table has not detected OpenMP support. It will still work but in single-threaded mode. If this is a Mac and you obtained the Mac binary of data.table from CRAN, CRAN's Mac does not support OpenMP.

Compiling R allows the user to use libraries such as OpenBLAS that can enhance performance for some operations.

What do you need to do this?

You’ll need Homebrew and XCode installed. How to do that? check these links

Its possible to install just Command Line Tools for XCode from Apple Developers instead of full XCode.

How do you do this?

This script will install R and Python. R will be installed with OpenBLAS, OpenMP and rJava enabled.

To leave a comment for the author, please follow the link and comment on their blog: Pachá (Batteries Included).

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)