junhewk / RcppMeCab

RcppMeCab: Rcpp Interface of CJK Morpheme Analyzer MeCab
24 stars 8 forks source link

failed to install #2

Closed yuanzhouIR closed 6 years ago

yuanzhouIR commented 6 years ago

Hello! I tried to install the 'RccpMeCab' package, but failed. I have installed the 'RMeCab' package, and when I ran install.packages("RccpMeCab"), the information returned is as following:

Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘RcppMeCab’ Do you want to attempt to install these from sources? (Yes/no/cancel) y installing the source package ‘RcppMeCab’

trying URL 'https://cran.rstudio.com/src/contrib/RcppMeCab_0.0.1.1.tar.gz' Content type 'application/x-gzip' length 23491 bytes (22 KB)

downloaded 22 KB

The downloaded source packages are in ‘/private/var/folders/hg/q395slr53q5_6g6xcwy8cxnw0000gn/T/Rtmp6QRLLL/downloaded_packages’

My environment information is

R version 3.5.0 (2018-04-23) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.5

Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] RMeCab_1.00 devtools_1.13.5

loaded via a namespace (and not attached): [1] httr_1.3.1 compiler_3.5.0 rvcheck_0.1.0 R6_2.2.2 tools_3.5.0 withr_2.1.2
[7] curl_3.2 memoise_1.1.0 git2r_0.21.0 digest_0.6.15

Can you help me to fix the problem?

junhewk commented 6 years ago

Hi @SyuuGenn ,

/bin/sh: mecab-config: command not found

means that you didn't install MeCab libraries before installing the package, or R shell couldn't find the libraries.

Your system is MacOS X, therefore downloading MeCab source and IPA dictionary.

In the Terminal, go to the directory you downloaded two files and run following commands:

 $ tar zxfv mecab-0.996.tar.gz
 $ cd mecab-0.996
 $ ./configure 
 $ make
 $ make check
 $ sudo
 $ make install

and

$ tar zxfv mecab-ipadic-2.7.0-200720801.tar.gz
$ cd mecab-ipadic-2.7.0-20070801
$ ./configure
$ make
$ su
$ make install

It is little bit weird for me, since you installed RMeCab and it needs MeCab library too. Maybe you should check your PATH variable. Is which mecab-config (in the Terminal) returns the directory?

yuanzhouIR commented 6 years ago

Thank you, @junhewk ! I ran your code, and then installed "RccpMeCab" successfully.