problems installing packages in R.Studio.cloud

I am teaching with Rstudio.cloud for the first time and so far it has been great. But we ran into a problem today with knitting. Many people had to update a bunch of packages today to make the knit work. That's fine. But for one person, the packages are not loading. Specifically, it wanted updated versions of knitr, stringr, and rmarkdown. They clicked the yes button to update. But it didn't work. After much playing around, I discovered that the stringi package (part of stringr, at least) was not loading and we got the error that it had "non-zero exit status". I have tried everything I can think of or find on the web. I've removed the packages and reinstalled them. I've reloaded the project and reinstalled. I tried installing with "win.binary" and it said it can't do that on this platform (I assume the cloud). I'm not a techy, so I'm sorry, if there is an easy answer that I've missed. The project in question is: https://rstudio.cloud/spaces/24707/project/470465.

Unfortunately we teach on a very condensed system - we'll be done with this course in 3 weeks (having covered a semester of material in 3.5 weeks), so any quick answers would be very, very appreciated. Thanks!

Edited to add that this student can knit in a different project in their workspace. The problem appears to be just in this project.

Hi there,

Can you try to reinstall the stringi package manually and copy the entire output here?

install.packages('stringi')

Thanks
-Andy

Sure. Here is the output I got:

install.packages("stringi")
Installing package into ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'http://package-proxy/src/contrib/stringi_1.4.3.tar.gz'
Content type 'application/x-tar' length 2337898 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

ERROR: failed to lock directory ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.6’ for modifying
Try removing ‘/home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-stringi’
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpaSVrws/downloaded_packages’

Thanks for your help! Note that I did try removing 00LOCK-stringi and it claimed that no such package existed. But maybe I did that wrong?

You can fix this by deleting the 00LOCK-stringi directory. In the files tab of your RStudio.cloud instance, click the three dots next to the "Go to Project" button (the little R symbol). This should open the "Go to Folder" dialog box. Enter /home/rstudio-user/R/x86_64-pc-linux-gnu-library/3.6/ there. You should be able to see a 00LOCK-stringi directory - delete that, and you'll be able to install the package.

2 Likes

That did it! Thank you so much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.