R语言,installation of package ‘xxx’ had non-zero exit status

感谢文末博主!!!本来安装 knitr 报错,报错如下:

Error: package or namespace load failed for 'knitr' in library.dynam(lib, package, package.lib):

DLL 'xfun' not found: maybe not installed for this architecture?

错误: 载入失败
停止执行

*** arch - x64
ERROR: loading failed for 'i386'
 * removing 'C:/Users/hjs/Documents/PycharmProjects/_Tools/R/R-4.0.2/library/knitr'
Warning in install.packages("knitr", repos = "https://mirrors.ustc.edu.cn/CRAN/") :
  
installation of package ‘knitr’ had non-zero exit status

错误提示:installation of package ‘knitr’ had non-zero exit status

  • 将:
    install.packages(“knitr”)
  • 修改成:
    install.packages(“knitr”, dependencies=TRUE, type=‘binary’)

  • 安装成功!!

参考:https://blog.csdn.net/qq_41596063/article/details/126724088

你可能感兴趣的:(软件经验,r语言,开发语言)