r - XML 安装似乎失败并且未在 R 上加载
问题描述
在安装并尝试加载一些用于生物数据分析的软件包时,我不断收到一条错误消息
Error: package or namespace load failed for ‘DESeq2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘XML’
然后我手动安装了 XML 包:
install.packages("XML")
它打印了这个:
There is a binary version available but the source version is later:
binary source needs_compilation
XML 3.99-0.4 3.99-0.5 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
installing the source package ‘XML’
trying URL 'https://cran.rstudio.com/src/contrib/XML_3.99-0.5.tar.gz'
Content type 'application/x-gzip' length 968563 bytes (945 KB)
downloaded 945 KB
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/private/var/folders/rp/6tc118312dd069l9827kcfk40000gq/T/RtmpiQB0wX/R.INSTALLd016cd4140e/XML':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘XML’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/XML’
Warning in install.packages :
installation of package ‘XML’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/rp/6tc118312dd069l9827kcfk40000gq/T/RtmpZZUrSn/downloaded_packages’
然后当我用库(XML)加载包时:
Error in library(xml) : there is no package called ‘xml’
许多其他包(如 data.table 等)都发生了这种情况
解决方案
在您的情况下,C 编译器无法正常工作:
checking whether the C compiler works... no
尝试安装以前的版本(例如:)3.99-0.4
和/或手动安装。
从 Cran 下载:https ://cran.r-project.org/src/contrib/Archive/XML/
您可以使用以下命令手动安装软件包
install.packages('package.tar.gz', lib='destination_directory_of_downloaded_package',repos = NULL)
请参阅 的帮助以?install.packages
获取更多说明。
安装后检查包是否可用:
installed.packages()[1:5,]
推荐阅读
- c# - DocumentFormat.OpenXml 错误 - .xslx 的文件格式和扩展名不匹配
- reactjs - 如何用玩笑模拟上下文提供者中的单个状态变量?
- json - 如何在 Julia 中将 JSON 字符串转换为多个结构
- javascript - API unsplash.com 随机首次渲染耗时较长
- python - 测试以检查是否引发记录器警告不起作用
- typescript - typescript 基于操作静态扩展类型(类型安全)
- python - 页面布局的Python selenium打印页面问题
- python - 如何通过网络检查两个目录是否包含相同的文件?
- python - 如何检查列的 str 值,确定另一列是否小于/大于 [x] 在新建列中返回布尔值
- vulkan - 使 Vulkan 内存无效和刷新的正确方法