2017-08-17 161 views
1
> install.packages("Rglpk") 
Package which is only available in source 
    form, and may need compilation of 
    C/C++/Fortran: ‘Rglpk’ 
Do you want to attempt to install these from sources? 
y/n: y 
installing the source package ‘Rglpk’ 

試開URL’https://cran.rstudio.com/src/contrib/Rglpk_0.6-3.tar.gz' 
Content type 'application/x-gzip' length 20892 bytes (20 KB) 
================================================== 
downloaded 20 KB 

* installing *source* package ‘Rglpk’ ... 
** 成功將‘Rglpk’程序包解包並MD5和檢查 
** libs 
/bin/sh: line 0: cd: GLPK: No such file or directory 
make: *** [GLPK.ts] Error 1 
ERROR: compilation failed for package ‘Rglpk’ 
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rglpk’ 
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rglpk’ 
Warning in install.packages : 
    installation of package ‘Rglpk’ had non-zero exit status 

The downloaded source packages are in 
    ‘/private/var/folders/b2/ph_1yql507ddv6d659lcm99h0000gn/T/Rtmpfm2CvV/downloaded_packages’ 

我的RStudio是全新的(今天剛下載) 謝謝!在Mac上安裝「Rglpk」有什麼問題?

+1

在安裝此R軟件包之前,您必須在您的系統上安裝GLPK。 – Roland

回答

1

rglpk只是GMPK庫的接口,必須在安裝rglpk之前安裝在系統上。對於MacOS,您可以使用Homebrewinstall it manually進行安裝。

+0

非常感謝!成功! – vie

+1

homebrew命令是'brew install glpk'。 –