在安装R包时,你是否遇到类似这样的报错呢?

在安装DropletTestFiles包的时候老是提示如下的错误。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'DropletTestFiles' in library.dynam(lib, package, package.lib):
  DLL 'cachem' not found: maybe not installed for this architecture?
  错误: 载入失败
停止执行
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/Users/XXXXX/Documents/R/win-library/4.0/DropletTestFiles'

如果出现类似这样的报错基本都是同样的问题,不兼容多架构的问题。

1
2
3
4
5
6
7
*** arch - i386
Error: package or namespace load failed for 'XXXXXXX' in library.dynam(lib, package, package.lib):
  DLL 'XXXX' not found: maybe not installed for this architecture?
  错误: 载入失败
停止执行
*** arch - x64
ERROR: loading failed for 'i386'

具体解决办法,将原本的安装代码BiocManager::install("DropletTestFiles") 改成 BiocManager::install("DropletTestFiles",INSTALL_opts="--no-multiarch")

如果是从CRAN安装包的话,同样在后面追加INSTALL_opts="--no-multiarch" 这个参数,基本能解决问题。