15
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

R をインストールすると brew doctor に怒られるのを回避する

Posted at

R for Mac OS X をインストールすると /usr/local/ に知らないものが入っていると Homebrew に怒られる。

$ brew doctor
...

Warning: Unbrewed dylibs were found in /usr/local/lib.
...

Unexpected dylibs:
    /usr/local/lib/libtcl8.5.dylib
    /usr/local/lib/libtcl8.6.dylib
    /usr/local/lib/libtk8.5.dylib
    /usr/local/lib/libtk8.6.dylib

警告が邪魔だからといって、ライブラリを削除したり移動したりすると当然 R で問題がでる。

> install.packages("ggplot2")
--- Please select a CRAN mirror for use in this session ---
Error: .onLoad failed in loadNamespace() for 'tcltk', details:
  call: fun(libname, pkgname)
  error: Tcl/Tk libraries are missing: install the Tcl/Tk component from the R installer

(このエラーに会った人は R for MacOS X を再インストールすれば治ります。)

実は brew doctor は /usr/local/lib/ にどんなディレクトリやシンボリックリンクがあっても気にしないみたいなので、警告されたファイルをどこかに移動して、シンボリックリンクを /usr/local/lib にはれば警告は回避できる。

$ cd /usr/local/lib
$ ln -s <somewhere>/libtcl*.dylib .
$ ln -s <somewhere>/libtk*.dylib .

これ以外のヘッダファイルなんかは無くても問題ない。/usr/lib に Tcl/Tk はちゃんと入っているので、R以外のアプリケーションが R のインストールした Tcl/Tk を必要とすることはないと思う。

おしまい。

もっと正統的な回避策としては Homebrew でRをインストールしても良いらしい。私は試してない。

15
15
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?