2

重现:

  1. 按照https://github.com/yencarnacion/GCP-jupyter-notebook的 README 中的说明进行操作
  2. 打开一个 R jupyter notebook 并执行:

    system("mkdir -p ~/anaconda3/lib/R/library", intern=TRUE)

    system("echo R_LIBS=~/anaconda3/lib/R/library > ~/.Renviron", intern=TRUE)

    * Then do a Kernel>Restart and in the first cell of your notebook put:

    .libPaths("~/anaconda3/lib/R/library")

  3. 正如用户 ubuntu 所做的那样:

    • wget https://cran.rstudio.com/src/contrib/Rcpp_0.12.10.tar.gz
  4. 正如用户 ubuntu 所做的那样:
    • /usr/lib/anaconda/lib/R/bin/R CMD INSTALL --library=~/anaconda3/lib/R/library Rcpp_0.12.10.tar.gz

这是我得到的输出/usr/lib/anaconda/lib/R/bin/R CMD INSTALL --library=~/anaconda3/lib/R/library Rcpp_0.12.10.tar.gz

* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c Date.cpp -o Date.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c Module.cpp -o Module.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c Rcpp_init.cpp -o Rcpp_init.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c api.cpp -o api.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c attributes.cpp -o attributes.o
g++ -I/usr/lib/anaconda/lib/R/include -DNDEBUG -I../inst/include/ -I/usr/lib/anaconda/include    -fpic  -I/usr/lib/anaconda/include  -c barrier.cpp -o barrier.o
g++ -shared -L/usr/lib/anaconda/lib/R/lib -L/usr/lib/anaconda/lib -lgfortran -o Rcpp.so Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -L/usr/lib/anaconda/lib/R/lib -lR
installing to /home/ubuntu/anaconda3/lib/R/library/Rcpp/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/ubuntu/anaconda3/lib/R/library/Rcpp/libs/Rcpp.so':
  /home/ubuntu/anaconda3/lib/R/library/Rcpp/libs/Rcpp.so: undefined symbol: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/ubuntu/anaconda3/lib/R/library/Rcpp’

由于 Rcpp 问题,我无法解决devtools::install_github('rstudio/leaflet')其他问题。

注意:这个问题可能与R 中的 Rcpp package not install ubuntu 14.04有关

4

2 回答 2

1

你可以通过 conda 安装 Rcpp:

conda install r-rcpp
于 2017-08-17T09:20:56.290 回答
0

仅供参考,您可以使用 GCP 的新AI Platform Notebooks在几秒钟内为 GCP 上的 R 创建 Jupyter Notebook 。

在 GCP 控制台中,转到 AI Notebooks -> New Instance -> 选择 R。您应该能够安装所需的任何 R 包

于 2019-07-01T00:20:55.627 回答