【问题标题】:tm package installation errors in R version 3.6.1 (2019-07-05) -- "Action of the Toes"R 版本 3.6.1 (2019-07-05) 中的 tm 包安装错误 -- “Action of the Toes”
【发布时间】:2020-02-27 14:55:53
【问题描述】:

我正在尝试在 macOS High Sierra 版本 10.13.6 下运行的 Macbook Pro(2011 年末)上使用 R 中的 tm 包。 tm 包已经安装,但是当我加载它时,我收到以下错误消息

Error: package or namespace load failed for ‘tm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘slam’

然后我尝试安装 slam 并得到了这个:


  There is a binary version available but the source
  version is later:
     binary source needs_compilation
slam 0.1-45 0.1-46              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y
installing the source package ‘slam’

trying URL 'https://cran.rstudio.com/src/contrib/slam_0.1-46.tar.gz'
Content type 'application/x-gzip' length 53515 bytes (52 KB)
==================================================
downloaded 52 KB

* installing *source* package ‘slam’ ...
** package ‘slam’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c apply.c -o apply.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c dll.c -o dll.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c grouped.c -o grouped.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c sparse.c -o sparse.o
clang -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include  -fPIC  -Wall -g -O2  -c util.c -o util.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o slam.so apply.o dll.o grouped.o sparse.o util.o -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [slam.so] Error 1
ERROR: compilation failed for package ‘slam’
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/slam’
Warning in install.packages :
  installation of package ‘slam’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/zq/lzsw_rp15sj3wtfvb3r0kksc0000gn/T/RtmpX95gez/downloaded_packages’```
Can anyone please help me fix this?
Thanks!

【问题讨论】:

    标签: r tm slam


    【解决方案1】:

    我今天遇到了完全相同的问题。我正在使用 macOS Mojave (10.14.6) 的 Mac Book Pro 上运行 R 3.6.1(和你一样),并且我有相同的错误消息。

    我从这里尝试了一些答案: dependency ‘slam’ is not available when installing TM package

    通过尝试:

    install.packages("NLP", dependencies = TRUE)
    install.packages("tm", dependencies = TRUE)
    

    .....但没有快乐。

    所以我去了这里: https://cran.r-project.org/web/packages/slam/index.html 并将slam_0.1-45.tgz 下载到我的下载文件夹 然后直接从那里安装它,使用:

    install.packages("~/Downloads/slam_0.1-45.tgz", repos = NULL, type = .Platform$pkgType)
    

    现在似乎可以正常安装 tm 包了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-02-13
      • 2017-07-23
      • 2017-10-04
      • 1970-01-01
      • 2013-06-09
      • 2020-02-09
      相关资源
      最近更新 更多