在R中安装软件包:找不到'stdlib.h'文件

问题描述 投票:0回答:2

我正在尝试从RStudio安装RMark。我注意到无法安装其中一个软件包。 C似乎有些问题你能帮助我吗?

> 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
> 
r package install stdio
2个回答
0
投票

你已经使用conda安装了R(我猜,从路径开始)所以使用conda procedures而不是install.packages()安装软件包。


1
投票

如果您尝试安装conda repo中不存在的软件包,您还可以为Mojave安装所需的SDK标头

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Source

© www.soinside.com 2019 - 2024. All rights reserved.