RevolutionAnalytics / RRO

Revolution R Open
http://mran.revolutionanalytics.com/download/
GNU General Public License v2.0
86 stars 25 forks source link

"not writable" error when installing new packages on 3.2.0 #144

Closed revodavid closed 9 years ago

revodavid commented 9 years ago

I get an error when attempting to install packages:

> install.packages("stringr")
Warning in install.packages("stringr") :
  'lib = "C:/Program Files/RRO/R-3.2.0/library"' is not writable
Error in install.packages("stringr") : unable to install packages
> Revo.version
         _  
major    3  
minor    2.0
build id 58 
nathansoz commented 9 years ago

This is not a bug. As a normal user you would not have write access to anything in C:\Program Files. When I try this, it prompts me to make a personal library.

If you want to install to the system library, you must run R or Rgui as administrator.

nathansoz commented 9 years ago

R windows FAQ documents this behavior:

http://cran.r-project.org/bin/windows/base/rw-FAQ.html 2.24 Does R run under Windows Vista/7/8/Server 2008? ... If you install R as a standard user into your own file space and use it under the same account, there are no known permission issues.

If you use the default Administrator account (without ‘admin approval mode’ being turned on) and install/update packages (in the system area or elsewhere), no issues are known.

If you use an account in the local Administrators group in ‘admin approval mode’ (which is the intended norm under these OSes), installation will make use of ‘over-the-shoulder’ credentials. You will run into problems if you try installing (including updating) packages in the main R library. (It would be nice if at that point R could use over-the-shoulder credentials, but they apply to processes as a whole. Vista and later disallow creating .dll files in the system area without credentials.) There are several ways around this.

Run R with Administrator privileges in sessions where you want to install packages. (Do so by right-clicking on the R shortcut and selecting ’Run as Administrator’.) Transfer ownership of the R installation to the user which installed R. To do so, use the security tab on the ‘Properties’ of the top-level R folder and give ‘Full Control’ over this directory to the user (not just the Administrator group). Install packages into a different library tree owned by the account used to install R. For an installation to be used by a single user, the simplest way is to make use of a ‘personal library’: See I don't have permission to write to the R-3.2.0\library directory. ...

revodavid commented 9 years ago

Package installs work out-of-the-box in CRAN R 3.2.0, and the same must be true of RRO.

> install.packages("stringr")
Installing package into ‘C:/Users/davidsmi/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘stringi’, ‘magrittr’

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/stringi_0.4-1.zip'
Content type 'application/zip' length 13432789 bytes (12.8 MB)
downloaded 12.8 MB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/magrittr_1.5.zip'
Content type 'application/zip' length 149714 bytes (146 KB)
downloaded 146 KB

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/stringr_1.0.0.zip'
Content type 'application/zip' length 83186 bytes (81 KB)
downloaded 81 KB

package ‘stringi’ successfully unpacked and MD5 sums checked
package ‘magrittr’ successfully unpacked and MD5 sums checked
package ‘stringr’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\davidsmi\AppData\Local\Temp\RtmpknEfi6\downloaded_packages
nathansoz commented 9 years ago

Yes. In your example you are installing to your local personal library: C:/Users/davidsmi/Documents/R/win-library/3.2

revodavid commented 9 years ago

In a default install of R it works. In a default install of RRO it does not work.

nathansoz commented 9 years ago

@revodavid and I discussed this issue on the phone and have cleared up why the behavior is happening. It mirrors the behavior of R, and the behavior for each will be different depending on if R or RRO was previously installed. @revodavid is re-testing and will report back.

revodavid commented 9 years ago

Issue only occurs on a system where a package has never been installed before (in R or RRO), and the ~/Documents/R/win-library/ folder does not exist. (You can recreate the issue by deleting that folder.)

Confirmed that RRO has the same behaviour as CRAN R in this instance: to prompt the user to create the ~/Documents/R/win-library/ folder.

j-martens commented 9 years ago

Are there any actions needed here or can we close this defect?

revodavid commented 9 years ago

It is already closed.

hendrohwibowo commented 6 years ago

in my case, just delete 00LOCK-car folder in ~/Documents/R/win-library/, with car is the package it is trying to installed (it is when i am updating using Tools-Check for Package Updates...).

sabyasachi1992 commented 4 years ago

install.packages("sp") WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/ Installing package into ‘C:/Users/sabyasachi/Documents/R/win-library/4.0’ (as ‘lib’ is unspecified) Warning in install.packages : 'lib = "C:/Users/sabyasachi/Documents/R/win-library/4.0"' is not writable Error in install.packages : unable to install packages

what will be the solution for this?