在 R 中安装包:找不到“stdlib.h"文件 [英] Install package in R: 'stdlib.h' file not found

查看:59
本文介绍了在 R 中安装包:找不到“stdlib.h"文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 RStudio 安装 RMark.我注意到无法安装所需的软件包之一.似乎 C 有一些问题.你能帮我吗?

I am trying to install RMark from RStudio. I notice that one of the packages required could not be installed. It seems there are some issues with C. Can you help me?

> install.packages('mvtnorm')
trying URL 'https://cran.rstudio.com/src/contrib/mvtnorm_1.0-8.tar.gz'
Content type 'application/x-gzip' length 159539 bytes (155 KB)
==================================================
downloaded 155 KB

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_TIME failed, using "C" 
3: Setting LC_MESSAGES failed, using "C" 
4: Setting LC_MONETARY failed, using "C" 
* installing *source* package 'mvtnorm' ...
** package 'mvtnorm' successfully unpacked and MD5 sums checked
** libs
x86_64-apple-darwin13.4.0-clang -I"/anaconda3/lib/R/include" -DNDEBUG   -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -I/anaconda3/include   -fPIC  -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -I/anaconda3/include -fdebug-prefix-map==/usr/local/src/conda/- -fdebug-prefix-map==/usr/local/src/conda-prefix  -c C_FORTRAN_interface.c -o C_FORTRAN_interface.o
In file included from C_FORTRAN_interface.c:8:
In file included from ./mvtnorm.h:2:
/anaconda3/lib/R/include/R.h:55:11: fatal error: 'stdlib.h' file not found
# include <stdlib.h> /* Not used by R itself, but widely assumed in packages */
          ^~~~~~~~~~
1 error generated.
make: *** [/anaconda3/lib/R/etc/Makeconf:160: C_FORTRAN_interface.o] Error 1
ERROR: compilation failed for package 'mvtnorm'
* removing '/anaconda3/lib/R/library/mvtnorm'
Warning in install.packages :
  installation of package 'mvtnorm' had non-zero exit status

The downloaded source packages are in
	'/private/var/folders/5m/lbpq3yj53n7clgx4r1fy6blr0000gn/T/RtmppNGt3S/downloaded_packages'
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
> 

推荐答案

你已经使用 conda 安装了 R(我猜是从路径)所以使用 conda 程序 而不是 install.packages().

You've installed R using conda (I guess, from the path) so install packages using conda procedures rather than install.packages().

这篇关于在 R 中安装包:找不到“stdlib.h"文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆