最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

r - Renv::install is failing whenever a package has Rccp as a dependency - Stack Overflow

programmeradmin7浏览0评论

Trying to get the renv package to work, and I'm just testing it by installing randomly selected package from CRAN.

So far, two packages, acro and jskm (selected randomly, both uploaded since the start of the year) cause failure on the renv::install() stage when it gets to Rccp:

Error: Error installing package 'Rcpp':
================================

* installing *source* package 'Rcpp' ...
** using staged installation
rm -f Rcpp.o RcppExample.o  Rcpp.dll
Building MyLib in inst/lib...
g++ -std=gnu++17 -O2 -Wall -mfpmath=sse -msse2 -mstackrealign   -c -o Adder.o Adder.cpp
g++ -std=gnu++17 -O2 -Wall -mfpmath=sse -msse2 -mstackrealign   -c -o Multiplier.o Multiplier.cpp
ar r libMyLib.a Adder.o Multiplier.o
C:\rtools44\x86_64-w64-mingw32.static.posix\bin\ar.exe: creating libMyLib.a
ranlib libMyLib.a
ERROR: a 'NAMESPACE' file is required
* removing '%devpath%/renv_testing/renv/staging/1/Rcpp'
install of package 'Rcpp' failed [error code 1]

Renv installs packages here: "%devpath%/renv_testing/renv/library/windows/R-4.4/x86_64-w64-mingw32". From my understanding, renv is pretty smart and should recognise the NAMESPACE file w/in %install_path%/renv? I have no issues when I install to my global R library folder with the traditional packages.install method.

I do have C++ installed and a compiler and have used C++ (C++98) on this machine so I know it works, just for some reason not working with renv.

Edit: Tidyverse installed just fine, just tried it as a sanity check.

Edit2: Did some more digging around, and came across this issues thread from the renv gh repo, not sure at all if its related to my issue, but if it is I guess I just have to wait or hope for someone else to figure out a workaround.

Trying to get the renv package to work, and I'm just testing it by installing randomly selected package from CRAN.

So far, two packages, acro and jskm (selected randomly, both uploaded since the start of the year) cause failure on the renv::install() stage when it gets to Rccp:

Error: Error installing package 'Rcpp':
================================

* installing *source* package 'Rcpp' ...
** using staged installation
rm -f Rcpp.o RcppExample.o  Rcpp.dll
Building MyLib in inst/lib...
g++ -std=gnu++17 -O2 -Wall -mfpmath=sse -msse2 -mstackrealign   -c -o Adder.o Adder.cpp
g++ -std=gnu++17 -O2 -Wall -mfpmath=sse -msse2 -mstackrealign   -c -o Multiplier.o Multiplier.cpp
ar r libMyLib.a Adder.o Multiplier.o
C:\rtools44\x86_64-w64-mingw32.static.posix\bin\ar.exe: creating libMyLib.a
ranlib libMyLib.a
ERROR: a 'NAMESPACE' file is required
* removing '%devpath%/renv_testing/renv/staging/1/Rcpp'
install of package 'Rcpp' failed [error code 1]

Renv installs packages here: "%devpath%/renv_testing/renv/library/windows/R-4.4/x86_64-w64-mingw32". From my understanding, renv is pretty smart and should recognise the NAMESPACE file w/in %install_path%/renv? I have no issues when I install to my global R library folder with the traditional packages.install method.

I do have C++ installed and a compiler and have used C++ (C++98) on this machine so I know it works, just for some reason not working with renv.

Edit: Tidyverse installed just fine, just tried it as a sanity check.

Edit2: Did some more digging around, and came across this issues thread from the renv gh repo, https://github/rstudio/renv/issues/2118 not sure at all if its related to my issue, but if it is I guess I just have to wait or hope for someone else to figure out a workaround.

Share Improve this question edited Mar 20 at 13:51 nos codemos asked Mar 20 at 11:03 nos codemosnos codemos 6911 gold badge8 silver badges26 bronze badges 2
  • I'm literally having this same problem at the same time. :-) ... but it happens even when I just attempt to directly install Rcpp in renv. I.e., renv::install("Rcpp") – Abe Commented Mar 20 at 15:56
  • I was just about to edit this, but I think the github issue I linked to is in-fact the issue. I dropped down to [email protected] and it worked fine. As per the issue, 1.1.3 for some reason has the Rccp version as 1.3, which does not exist. This is ostensibly what's causing the error. They are aware of the problem and it should be resolved quickly, I hope. – nos codemos Commented Mar 20 at 15:59
Add a comment  | 

2 Answers 2

Reset to default 2

Sorry for the trouble. renv 1.1.4 has just been released to CRAN, and the issue should be resolved in this version.

I think the issue is indeed what is outlined in the linked URL github issue. One of the dependencies is looking for [email protected], which doesn't exist. Lowering renv down to 1.1.2, no issues. I had a coworker test as well and we were able to produce similar results. Therefore the best bet to avoid this issue (for the time being) is to drop down to [email protected]. Even on [email protected] specifying a different version of Rcpp didn't yield success.

发布评论

评论列表(0)

  1. 暂无评论