我在Centos 6中运行R.我需要删除R中的一些软件包。在这样做并尝试重新安装之后,我被告知需要安装rgl软件包。现在当我尝试安装它时,我收到以下错误。
install.packages("rgl")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘sourcetools’, ‘shiny’
trying URL 'http://cran.rstudio.com/src/contrib/sourcetools_0.1.2.tar.gz'
Content type 'application/x-gzip' length 16227 bytes (15 KB)
==================================================
downloaded 15 KB
trying URL 'http://cran.rstudio.com/src/contrib/shiny_0.14.tar.gz'
Content type 'application/x-gzip' length 2110934 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
trying URL 'http://cran.rstudio.com/src/contrib/rgl_0.96.0.tar.gz'
Content type 'application/x-gzip' length 2489778 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
* installing *source* package ‘sourcetools’ ...
** package ‘sourcetools’ successfully unpacked and MD5 sums checked
** libs
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I../inst/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Reader.cpp -o Reader.o
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I../inst/include -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Tokenizer.cpp -o Tokenizer.o
In file included from ../inst/include/sourcetools/cursor/TokenCursor.h:7,
from ../inst/include/sourcetools/cursor/cursor.h:5,
from ../inst/include/sourcetools.h:11,
from Tokenizer.cpp:1:
../inst/include/sourcetools/tokenization/Token.h: In constructor ‘sourcetools::tokens::Token::Token()’:
../inst/include/sourcetools/tokenization/Token.h:27: error: ‘nullptr’ was not declared in this scope
../inst/include/sourcetools/tokenization/Token.h: In constructor ‘sourcetools::tokens::Token::Token(sourcetools::tokens::TokenType)’:
../inst/include/sourcetools/tokenization/Token.h:34: error: ‘nullptr’ was not declared in this scope
../inst/include/sourcetools/tokenization/Token.h: In constructor ‘sourcetools::tokens::Token::Token(const sourcetools::tokens::Token::Position&)’:
../inst/include/sourcetools/tokenization/Token.h:41: error: ‘nullptr’ was not declared in this scope
../inst/include/sourcetools/tokenization/Token.h: In function ‘std::ostream& sourcetools::operator<<(std::ostream&, const std::vector<sourcetools::tokens::Token, std::allocator<sourcetools::tokens::Token> >&)’:
../inst/include/sourcetools/tokenization/Token.h:457: error: expected initializer before ‘:’ token
../inst/include/sourcetools/tokenization/Token.h:459: error: expected primary-expression before ‘return’
../inst/include/sourcetools/tokenization/Token.h:459: error: expected ‘;’ before ‘return’
../inst/include/sourcetools/tokenization/Token.h:459: error: expected primary-expression before ‘return’
../inst/include/sourcetools/tokenization/Token.h:459: error: expected ‘)’ before ‘return’
In file included from ../inst/include/sourcetools/cursor/cursor.h:5,
from ../inst/include/sourcetools.h:11,
from Tokenizer.cpp:1:
../inst/include/sourcetools/cursor/TokenCursor.h: In member function ‘bool sourcetools::cursors::TokenCursor::moveToPosition(const sourcetools::cursors::TokenCursor::Position&)’:
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘[’ token
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘]’ token
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘const’
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘const’
make: *** [Tokenizer.o] Error 1
ERROR: compilation failed for package ‘sourcetools’
* removing ‘/usr/lib64/R/library/sourcetools’
Warning in install.packages :
installation of package ‘sourcetools’ had non-zero exit status
ERROR: dependency ‘sourcetools’ is not available for package ‘shiny’
* removing ‘/usr/lib64/R/library/shiny’
Warning in install.packages :
installation of package ‘shiny’ had non-zero exit status
ERROR: dependency ‘shiny’ is not available for package ‘rgl’
* removing ‘/usr/lib64/R/library/rgl’
Warning in install.packages :
installation of package ‘rgl’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpdNMaV6/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
我已按照类似问题的建议,并尝试重新安装以下
sudo yum install mesa-libGL mesa-libGL-devel mesa-libGLU mesa-libGLU-devel
sudo yum groupinstall X11
但这没有效果。确实,我没想到它会有,因为我的错误消息中没有任何关于我可以看到的缺少库的信息(除了其他相互依赖的R库,我已经尝试单独安装) 。
答案 0 :(得分:1)
尝试安装sourcetools
时出现错误,shiny
rgl
使用sourcetools
使用的包。但是你没有安装最新版本curl -i -H "Accept: application/json" -H "Content-type:application/json" -X POST -d '{"student": {"name": "Duong", "score": "10"}}' http://api.1312100.com/students/
,版本0.1.5,这是一个非常新的更新。我建议你现在再试一次,你可能会看到不同的结果。
如果不是这样,您可能正在使用旧版本的R或某些正在强制使用旧版本软件包的软件包。您可以尝试更新到当前的R版本并更新所有软件包。