configure: error: Cannot find cairo.h! Please install cairo (http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS correspondingly

 

1、问题

复制代码
install.packages('Cairo', repos='https://mirror.lzu.edu.cn/CRAN/')
…………
…………
configure: error: Cannot find cairo.h! Please install cairo (http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS correspondingly.
ERROR: configuration failed for package ‘Cairo’
* removing ‘/home/software/R/lib64/R/library/Cairo’

The downloaded source packages are in/tmp/RtmpaXjXEm/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Cairo", repos = "https://mirror.lzu.edu.cn/CRAN/") :
  installation of package ‘Cairo’ had non-zero exit status
复制代码

 

 

2、解决方法

> quit()
Save workspace image? [y/n/c]: n

 

3、

复制代码
[root@centos8 ~]# yum  install cairo* libxt*
…………
…………
Upgraded:
  freetype-2.9.1-4.el8_3.1.x86_64             iptables-1.8.4-15.el8_3.3.x86_64       iptables-ebtables-1.8.4-15.el8_3.3.x86_64
  iptables-libs-1.8.4-15.el8_3.3.x86_64

Installed:
  cairo-devel-1.15.12-3.el8.x86_64           cairo-gobject-devel-1.15.12-3.el8.x86_64       expat-devel-2.2.5-4.el8.x86_64
  fontconfig-devel-2.13.1-3.el8.x86_64       freetype-devel-2.9.1-4.el8_3.1.x86_64          glib2-devel-2.56.4-8.el8.x86_64
  libXext-devel-1.3.4-1.el8.x86_64           libXrender-devel-0.9.10-7.el8.x86_64           libpng-devel-2:1.6.34-5.el8.x86_64
  libuuid-devel-2.32.1-24.el8.x86_64         pcre-cpp-8.42-4.el8.x86_64                     pcre-devel-8.42-4.el8.x86_64
  pcre-utf16-8.42-4.el8.x86_64               pcre-utf32-8.42-4.el8.x86_64                   pixman-devel-0.38.4-1.el8.x86_64

Complete!
复制代码

 

4、

复制代码
[root@centos8 ~]# R

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

>
复制代码

 

 

 

 

5、

复制代码
> install.packages('Cairo', repos='https://mirror.lzu.edu.cn/CRAN/')
…………
…………
** testing if installed package keeps a record of temporary installation path
* DONE (Cairo)

The downloaded source packages are in/tmp/RtmpM2ctTJ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
复制代码

 

6、测试

> library(Cairo)
>

 

posted @   小鲨鱼2018  阅读(3293)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示