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)
>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律