我不熟悉 Mac(我使用 Windows 和 Linux Mint),但我需要一个包,我需要能够告诉所有平台上的人们如何构建。该软件包依赖于openNLP
并且由于 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 的终端来做建议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。