简体   繁体   中英

Error message installing Cairo package in R

I want to install the Cairo package in R using:

install.packages("Cairo")

Unfortunately this doesn't work. The error message is following:

xlib-backend.c:34:74: fatal error: X11/Intrinsic.h: No such file or directory
compilation terminated.
make: *** [xlib-backend.o] Error 1
ERROR: compilation failed for package ‘Cairo’
* removing ‘/home/magnus/R/x86_64-pc-linux-gnu-library/3.1/Cairo’

Does anybody have an answer for this problem? I couldn't find any help in the inte.net so far.

Many thanks in advance!

Yours,

broesel

For me (Ubuntu 15.04) installing libxt-dev solved the problem.

(I know it's mentioned in comments above, but thought it might be good to have it in answers as well)

You need the development header as the file Intrinsic.h is not found.

For the related package cairoDevice (which I maintain for Debian), I ensure the following is installed:

libgtk2.0-dev, libcairo2-dev, xvfb, xauth, xfonts-base

If you are on a different distribution these might be called something else. The key is that the Gtk and Cairo header packages also pull in other, needed, x11 packages.

在 Fedora (25) 中需要安装libXt-devel

sudo dnf install libXt-devel

On a Mac, my problems were solved once I installed libxt

brew install libxt

Similar, I'm sure to https://stackoverflow.com/a/41455437/61728

除了 Dirk 在上述评论中提到的libgtk2.0-devlibcairo2-devxvfbxfonts-basexauth之外,我还安装了libxt-dev (在 Magnus 的评论之后),之后我能够在其中安装 Cairo R. 我使用的是 Ubuntu 16.04 LTS

I had a lot of trouble with this, for some reason this didn't work

apt-get install libx11-dev libxt-dev libgtk2.0-dev libcairo2-dev xvfb xauth xfonts-base -y

but when I ran this immediately afterwards (even though it was already installed above), then the Cairo R package installed successfully. Not exactly sure why but thought I'd put it here in case it helps someone.

apt-get install libcairo2-dev -y

I used this:

devtools::install_github("jcassiojr/BayesPeak")

then:

library("BayesPeak")

And worked. Paulo

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