我不熟悉Mac(我使用Windows和Linux Mint),但有一个软件包,我需要能够告诉所有平台上的人如何构建。此程序包依赖于openNLP
,因为encoding issues MacOS X无法通过install.packages("openNLP")
安装。
我让别人告诉我你仍然可以使用install.packages("openNLP", type="source")
安装,但我收到以下消息:
> install.packages("openNLP", type="source")
trying URL 'http://cran.rstudio.com/src/contrib/openNLP_0.0-8.tar.gz'
Content type 'application/x-gzip' length 807784 bytes (788 Kb)
opened URL
==================================================
downloaded 788 Kb
* installing *source* package ‘openNLP’ ...
/Library/Frameworks/R.framework/Resources/bin/config: line 142: make:
command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 143: make:
command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 219: make:
command not found
Could not determine the Java interpreter.
Maybe run R CMD javareconf?
ERROR: configuration failed for package ‘openNLP’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/openNLP’
The downloaded source packages are in
‘/private/var/folders/YW/YWal638NEwi-tFse3NsBFk+++TM/-Tmp-/RtmpaWdKnC/downloaded_packages’
Warning message:
In install.packages("openNLP", type = "source") :
installation of package ‘openNLP’ had non-zero exit status
所以我使用Mac的temrinal来做建议的R CMD javareconf
:
Java interpreter : /usr/bin/java
Java version : 1.6.0_37
Java home path :
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Java compiler : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar
Java library path:
JNI linker flags : -framework JavaVM
JNI cpp flags : -I$(JAVA_HOME)/include
Updating Java configuration in /Library/Frameworks/R.framework/Resources
Done.
尝试关闭R,重新打开,然后install.packages("openNLP", type="source")
,但会出现相同的消息。谷歌在这里没有帮助我,我对Mac非常不熟悉。我认为这与安装的java类型有关,但是对Mac的了解太少,因为这不是我的Mac机器。
请指示我正确安装openNLP。
答案 0 :(得分:1)
我刚刚使用R 2.15.2从Mas OSX 10.6.8上的源代码编译而没有错误。鉴于错误消息显示make
无法找到,听起来好像该机器尚未设置为从源编译。您是否了解默认情况下未安装XCode,并且您需要从Apple获取XCode才能编译“源”包?