gpt4 book ai didi

r - 在 Linux Mint 18.1 上安装 R 包时出现问题

转载 作者:行者123 更新时间:2023-12-02 03:51:21 26 4
gpt4 key购买 nike

所以我一直在尝试安装 Shiny 和 Devtools R 软件包,但我遇到了如下相同类型的错误:无论哪种类型的软件包,它总是有一个非零退出并包含“错误:未知类型名称"file"”消息。下面是一个例子。根据记录,我已经运行了 apt-get update 和升级命令,尝试重新安装 R 和 RStudio 等,但我一直遇到这个问题。

这是我的/etc/apt/sources.list:

#deb cdrom:[Linux Mint 18.1 _Serena_ - Release amd64 20161213]/ xenial contrib main non-free
deb http://cran.rstudio.com/bin/linux/ubuntu xenial/
deb https://cloud.r-project.org/bin/linux/ubuntu xenial/

我被困在这个问题上,谁能帮我弄清楚如何才能正确安装这些 R 软件包?我没有通过 RStudio 的 IDE 或 CLI 尝试它......这里缺少什么??????

install.packages("tibble")
Installing package into ‘/home/lennys/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘lazyeval’

trying URL 'https://cloud.r-project.org/src/contrib/lazyeval_0.2.0.tar.gz'
Content type 'application/x-gzip' length 317272 bytes (309 KB)
==================================================
downloaded 309 KB

trying URL 'https://cloud.r-project.org/src/contrib/tibble_1.2.tar.gz'
Content type 'application/x-gzip' length 54517 bytes (53 KB)
==================================================
downloaded 53 KB

* installing *source* package ‘lazyeval’ ...
** package ‘lazyeval’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c expr.c -o expr.o
In file included from expr.c:3:0:
/usr/share/R/include/Rinternals.h:1042:48: error: unknown type name ‘FILE’
void R_InitFileInPStream(R_inpstream_t stream, FILE *fp,
^
/usr/share/R/include/Rinternals.h:1045:50: error: unknown type name ‘FILE’
void R_InitFileOutPStream(R_outpstream_t stream, FILE *fp,
^
/usr/lib/R/etc/Makeconf:132: recipe for target 'expr.o' failed
make: *** [expr.o] Error 1
ERROR: compilation failed for package ‘lazyeval’
* removing ‘/home/lennys/R/x86_64-pc-linux-gnu-library/3.3/lazyeval’
ERROR: dependency ‘lazyeval’ is not available for package ‘tibble’
* removing ‘/home/lennys/R/x86_64-pc-linux-gnu-library/3.3/tibble’

The downloaded source packages are in
‘/tmp/RtmpvLx4dw/downloaded_packages’
Warning messages:
1: In install.packages("tibble") :
installation of package ‘lazyeval’ had non-zero exit status
2: In install.packages("tibble") :
installation of package ‘tibble’ had non-zero exit status
>

更多信息:我一直在尝试解决这个问题,但仍然没有成功。不过,我不断看到这种情况:

In file included from print_stderr.c:2:0:
/usr/share/R/include/Rinternals.h:1042:48: error: unknown type name ‘FILE’
void R_InitFileInPStream(R_inpstream_t stream, FILE *fp,
^
/usr/share/R/include/Rinternals.h:1045:50: error: unknown type name ‘FILE’
void R_InitFileOutPStream(R_outpstream_t stream, FILE *fp,

最佳答案

我没有答案,但我只能告诉你

  • CRAN 在 Debian 和 Fedora 上进行了测试,当然它可以在那里工作
  • Lost of people 使用 Ubuntu,Michael 通过他的 PPA 构建了 > 3k 软件包
  • 也许 Mint 更改了默认库
  • FILE 是非常简单的旧 C 语言,确实应该知道
  • 您的报告缺乏详细信息,因为我们无法判断您使用的是什么编译器、什么 libc...

话又说回来,首先要做的事情是:您是否安装了包 r-base-dev 以确保满足许多其他依赖项?

最后,从我的 Ubuntu 16.10 笔记本电脑登录:

edd@brad:~$ install.r tibble
trying URL 'https://cloud.r-project.org/src/contrib/tibble_1.2.tar.gz'
Content type 'application/x-gzip' length 54517 bytes (53 KB)
==================================================
downloaded 53 KB

* installing *source* package ‘tibble’ ...
** package ‘tibble’ successfully unpacked and MD5 sums checked
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -march=native -c RcppExports.cpp -o RcppExports.o
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -march=native -c matrixToDataFrame.cpp -o matrixToDataFrame.o
g++ -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o tibble.so RcppExports.o matrixToDataFrame.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/tibble/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (tibble)

The downloaded source packages are in
‘/tmp/downloaded_packages’
edd@brad:~$

标准建议:也许可以在 r-sig-debian 上询问,因为其他 Mint 用户潜伏在那里。

关于r - 在 Linux Mint 18.1 上安装 R 包时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42028292/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com