我似乎无法在R中安装devtools软件包。我已经尝试过使用dependencies = True的选项,但这也失败了。
我还尝试根据下面的错误日志安装“ ps”,看来可以正常安装。但是当我尝试在安装“ ps”后安装devtools时,会出现相同的错误。
有人可以建议我如何解决此问题吗?
> install.packages('devtools')
Installing package into ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘processx’, ‘xopen’, ‘callr’, ‘pkgbuild’, ‘pkgload’, ‘rcmdcheck’
trying URL 'https://cran.rstudio.com/src/contrib/processx_3.2.0.tar.gz'
Content type 'application/x-gzip' length 97959 bytes (95 KB)
==================================================
downloaded 95 KB
trying URL 'https://cran.rstudio.com/src/contrib/xopen_1.0.0.tar.gz'
Content type 'application/x-gzip' length 11221 bytes (10 KB)
==================================================
downloaded 10 KB
trying URL 'https://cran.rstudio.com/src/contrib/callr_3.0.0.tar.gz'
Content type 'application/x-gzip' length 36365 bytes (35 KB)
==================================================
downloaded 35 KB
trying URL 'https://cran.rstudio.com/src/contrib/pkgbuild_1.0.2.tar.gz'
Content type 'application/x-gzip' length 25264 bytes (24 KB)
==================================================
downloaded 24 KB
trying URL 'https://cran.rstudio.com/src/contrib/pkgload_1.0.2.tar.gz'
Content type 'application/x-gzip' length 55605 bytes (54 KB)
==================================================
downloaded 54 KB
trying URL 'https://cran.rstudio.com/src/contrib/rcmdcheck_1.3.2.tar.gz'
Content type 'application/x-gzip' length 1408582 bytes (1.3 MB)
==================================================
downloaded 1.3 MB
trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.0.1.tar.gz'
Content type 'application/x-gzip' length 388953 bytes (379 KB)
==================================================
downloaded 379 KB
* installing *source* package ‘processx’ ...
** package ‘processx’ successfully unpacked and MD5 sums checked
** libs
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -Wall tools/px.c -o tools/px
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g supervisor/supervisor.c supervisor/utils.c \
-o supervisor/supervisor
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c poll.c -o poll.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c processx-connection.c -o processx-connection.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c processx-vector.c -o processx-vector.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c create-time.c -o create-time.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/childlist.c -o unix/childlist.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/connection.c -o unix/connection.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/processx.c -o unix/processx.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/sigchld.c -o unix/sigchld.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/utils.c -o unix/utils.o
gcc -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/include -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c unix/named_pipe.c -o unix/named_pipe.o
gcc -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o processx.so init.o poll.o processx-connection.o processx-vector.o create-time.o unix/childlist.o unix/connection.o unix/processx.o unix/sigchld.o unix/utils.o unix/named_pipe.o -L/usr/local/lib/R/lib -lR
installing via 'install.libs.R' to /home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/processx
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘processx’:
.onLoad failed in loadNamespace() for 'processx', details:
call: loadNamespace(name)
error: there is no package called ‘ps’
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/processx’
Warning in install.packages :
installation of package ‘processx’ had non-zero exit status
ERROR: dependency ‘processx’ is not available for package ‘xopen’
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/xopen’
Warning in install.packages :
installation of package ‘xopen’ had non-zero exit status
ERROR: dependency ‘processx’ is not available for package ‘callr’
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/callr’
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
ERROR: dependency ‘callr’ is not available for package ‘pkgbuild’
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/pkgbuild’
Warning in install.packages :
installation of package ‘pkgbuild’ had non-zero exit status
ERROR: dependency ‘pkgbuild’ is not available for package ‘pkgload’
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/pkgload’
Warning in install.packages :
installation of package ‘pkgload’ had non-zero exit status
ERROR: dependencies ‘callr’, ‘pkgbuild’, ‘xopen’ are not available for package ‘rcmdcheck’
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/rcmdcheck’
Warning in install.packages :
installation of package ‘rcmdcheck’ had non-zero exit status
ERROR: dependencies ‘callr’, ‘pkgbuild’, ‘pkgload’, ‘rcmdcheck’ are not available for package ‘devtools’
* removing ‘/home/user/pq-tool/packrat/lib/x86_64-pc-linux-gnu/3.4.2/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpvzJcng/downloaded_packages’
答案 0 :(得分:0)
尝试
Sys.setenv(R_INSTALL_STAGED = FALSE)
install.packages("devtools", repos="http://cran.r-project.org", clean=TRUE)