conda中的R安装devtools包(Ubuntu)

运行安装在conda中的R,安装devtools时报错

Warning messages:
1: In install.packages("devtools") :
  installation of package ‘systemfonts’ had non-zero exit status
2: In install.packages("devtools") :
  installation of package ‘textshaping’ had non-zero exit status
3: In install.packages("devtools") :
  installation of package ‘ragg’ had non-zero exit status
4: In install.packages("devtools") :
  installation of package ‘pkgdown’ had non-zero exit status
5: In install.packages("devtools") :
  installation of package ‘devtools’ had non-zero exit status

安装缺少的依赖包install.packages("systemfonts")报错

In file included from caches.h:7,
                 from caches.cpp:1:
ft_cache.h:9:10: fatal error: ft2build.h: No such file or directory
    9 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [/home/ubuntu/miniconda3/envs/R/lib/R/etc/Makeconf:200: caches.o] Error 1
ERROR: compilation failed for package ‘systemfonts’
* removing ‘/home/ubuntu/miniconda3/envs/R/lib/R/library/systemfonts’

The downloaded source packages are in
    ‘/tmp/RtmprDf2Iy/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("systemfonts") :
  installation of package ‘systemfonts’ had non-zero exit status

主要问题是:ft_cache.h:9:10: fatal error: ft2build.h: No such file or directory,参考该链接方法(https://www.jianshu.com/p/8efd3c998282),发现是systemfonts编译过程中需判断是否支持pkg-config,因此是缺少pkg-config导致,安装后再次安装R包则成功

conda install pkg-config
R
install.packages("systemfonts")

接着安装devtools缺的其它几个依赖包,估计是和systemfonts一样的问题,解决了systemfonts的问题后,其它几个包也均安装成功

install.packages("textshaping")
install.packages("ragg")
install.packages("pkgdown")
#缺的依赖包装完后,再次安装devtools
install.packages("devtools")

成功安装!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容