Installing Rattle on Mac

To start: Update your MacOS to version 10.13.3, which takes a little while. You also need Xcode, which can take 20 minutes

A. Download the two key files.

B.  One method for installing Rattle is available at This method does not require Xcode.

C. The second method is on this page.

It requires downloading Xcode, which takes a while, so start on it early. .  

1. upgrade your Mac operating system to High Sierra. 10.13.3
2. install Xcode which can be downloaded from App Store. This takes a long time (20 minutes).
3. In the following instructions, write these commands in your Terminal application (available in Applications/Utilities, shift-Cmd-U ). The preface “MyComputer$” will look slightly different on your machine.

MyComputer$ xcode-select -p

### If you see above line, you have xcode command line tools installed.
### If you don’t see that output, execute the command below:

MyComputer$ xcode-select –install

### Then, execute the commands below, in Terminal.

MyComputer$ export PATH=/opt/local/bin:/opt/local/sbin:$PATH

MyComputer$ sudo port selfupdate

MyComputer$ sudo port install pkgconfig

MyComputer$ sudo port install gtk2 +x11

MyComputer$ R CMD INSTALL ~/Downloads/RGtk2_2.20.34.tar.gz

MyComputer$ R CMD INSTALL ~/Downloads/cairoDevice_2.24.tar.gz

### The last two command lines depends on your file names and folders, so make sure that the name is consistent with your own files and folders. For example, when you download RGtk2 and cairoDevice, they may arrive with file names that look like RGtk2_2.20.34.tar (no .gz). If so, use the name on your system.

You can now quit Terminal and start Rstudio. Follow the regular instructions for installing Rattle. For example (from Rstudio, not from Terminal):

install.packages(“rattle”, repos=””, type=”source”)




Once you get this far, you should never have to install Rattle again. You can just run it, from Rstudio or from R. And you won’t have to install.packages again, either. Just:



D. Why all this trouble? – An educational discussion

Despite the inconvenience of this installation, there are some useful lessons here about modern software and software ecosystems. Rattle and R are both open-source software, meaning that no company is formally responsible for their development. Instead, they are built by volunteers (some of whom are paid by their employers to work on the software). The results are that the software is available for free, and portions of it may be very sophisticated, and better than anything available from conventional software companies.

But conversely, with open source software programs the robustness (it doesn’t break) and usability (non-specialists can use it ) depends on how popular that program is, which determines how much effort the open source software community puts into developing it. The core pieces of R and Rstudio are both heavily used and relatively well developed. Rstudio, on the other hand, is more limited. The inventory, Graham Williams,  as far as I can tell uses Linux and Windows, but does not use Macintosh software. Therefore, when he updates Rstudio he develops and tests it first for Windows. Other users then have to come along and test/adapt it for Mac. The same situation appears to be true for several packages that Rattle and many other R packages depend on.

The same situation applies to some packages that Rattle depends on, especially something called RGtk2. As of today (4/5/2018), the CRAN page for RGtk2 says the following:

Reference manual: RGtk2.pdf
Package source: RGtk2_2.20.34.tar.gz
Windows binaries: r-prerel:, r-release:, r-oldrel:
OS X binaries: r-prerel: not available, r-release: not available

In other words, there is no compiled (binary) version of version 2.20.34 of RGtk2 for Macintosh operating system. What you are doing in the above instructions is compiling it yourself, so that it will be available when Rattle wants it.



Author: Roger Bohn

Professor of Technology Management, UC San Diego. Visiting Stanford Medical School Twitter =Roger.Bohn

8 thoughts on “Installing Rattle on Mac”

  1. Hello,

    Trying to install RGtk2 unsuccessfully following your roadmap … When I enter
    on the terminal : myMa$ R CMD INSTALL ~/Downloads/RGtk2_2.20.36.tar

    I get

    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded from temporary location
    objc[13605]: Class GNotificationCenterDelegate is implemented in both /opt/local/lib/libgio-2.0.0.dylib (0x10ddd1498) and /usr/local/opt/glib/lib/libgio-2.0.0.dylib (0x10d636568). One of the two will be used. Which one is undefined.
    Error: package or namespace load failed for ‘RGtk2’:
    .onLoad failed in loadNamespace() for ‘RGtk2’, details:
    call: .RGtkCall(“S_gtk_builder_get_type”, PACKAGE = “RGtk2”)
    error: object has no G type
    Error: loading failed
    Execution halted
    ERROR: loading failed
    * removing ‘/Users/Antonio/Library/R/3.6/library/RGtk2’

    > .libPaths()
    [1] “/Users/Antonio/Library/R/3.6/library”
    [2] “/Library/Frameworks/R.framework/Versions/3.6/Resources/library”

    Appreciate any help



    1. I have not kept up with this issue. But this year we found that most of Rattle works without RGtk2. That package is apparently dedicated to graphics. I believe that what students did was copy the R code from Rattle’s final tab, and then run it directly in RStudio.

      Be sure to check relevant discussions on!topic/rattle-users/ and on Stack overflow. Multiple methods are suggested for installing on Mac. Good luck!


  2. works like a charm,

    my observations:

    In the following steps:

    MyComputer$ R CMD INSTALL ~/Downloads/RGtk2_2.20.34.tar.gz
    MyComputer$ R CMD INSTALL ~/Downloads/cairoDevice_2.24.tar.gz

    download previously this files and the latest version (march 2019) is RGtk2_2.20.36.tar.gz
    Regarding the cairo Device, to this date, it is the latest version.

    the following instruction : install.packages(“rattle”, repos=””, type=”source”)

    you should copy and paste it like this:

    install.packages(“rattle”, repos=””, type=”source”)


  3. Hi again; However this one install.packages(“”, repos=NULL, type=”source”) works!!! tks a lot its because people like you that R is such a great tool.


  4. Dear Roger , tks a lot for putting this together . Do you know if using R through Anaconda could be a issue? when i try to install install.packages(“rattle”, repos=””, type=”source”) in R-Studio i get the following error –Error: unexpected input in “install.packages(�” , , I been trying for the last 3 days to get rattle going but its been a real chalenge


  5. Hi there, when I ran sudo port selfupdate, there’s a password requirement and I have no idea what does it mean by password here, please help me, thank you.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: