Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install_github having trouble with my local libraries #353

Closed
SimonHStats opened this issue Oct 8, 2013 · 25 comments
Closed

install_github having trouble with my local libraries #353

SimonHStats opened this issue Oct 8, 2013 · 25 comments

Comments

@SimonHStats
Copy link

Hi, I'm trying to install the 'rga' pacakge but I'm having no luck. I'm getting an issue with packages not being found in the local libraries.

Here's my input/output

install_github("rga", "skardhamar")
Installing github repo(s) rga/master from skardhamar
Downloading rga.zip from https://github.com/skardhamar/rga/archive/master.zip
Installing package from C:\Users\SIMON~1.HAY\AppData\Local\Temp\RtmpAX3mWl/rga.zip
Installing rga
"C:/PROGRA~1/R/R-30~1.1/bin/x64/R" --vanilla CMD INSTALL  \
  "C:\Users\simon.hayward\AppData\Local\Temp\RtmpAX3mWl\rga-master"  \
  --library="\\.../personal/.../simon.hayward/Documents/R/win-library/3.0"  \
  --with-keep.source --install-tests 

* installing *source* package 'rga' ...
** R
** preparing package for lazy loading
Warning: package 'lubridate' was built under R version 3.0.2
Warning: package 'httr' was built under R version 3.0.2
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
  there is no package called 'rga'
Error: loading failed
Execution halted
ERROR: loading failed
* removing '\\.../personal/.../simon.hayward/Documents/R/win-library/3.0/rga'
* restoring previous '\\.../personal/.../simon.hayward/Documents/R/win-library/3.0/rga'
Error: Command failed (1)

Is the error due to the filepath format for my library (\ at the beginning)? Is there a way to fix this? I don't understand why it is failing to find the rga.zip file in my library.
I have check that the library path is correct and open to my RStudio using .libPaths().

My R version is 3.0.1 and I have installed and found Rtools 3.0

@SimonHStats
Copy link
Author

My apologies if this is a duplicate, I did check similar problems and didn't see this raised.

@SimonHStats
Copy link
Author

I've asked a question related to this on StackOverflow, http://stackoverflow.com/questions/19221520/error-when-installing-rga-package but as you can see the title is a bit off, because i thought it was a problem with 'rga' but I've found the same problems with the 'ganalytics' package too.

EDIT: And I get a similar error for the 'shiny' package. All seems to be going fine and the I get told that there is no package called 'shiny' is it possible that install_github doesn't have access to the relevant library paths? (from the output it seems to, but doesn't seem to find what it needs.....

@hadley
Copy link
Member

hadley commented Oct 8, 2013

Could you please give me the output of .libPaths()?

@SimonHStats
Copy link
Author

Sure thing

.libPaths()
[1] "\..../personal/..../simon.hayward/Documents/R/win-library/3.0"
[2] "C:/Program Files/R/R-3.0.1/library"

The ellipses are just there to hide some company specific stuff.

EDIT: Just realised github is hiding some of the backslashes at the beginning of the first path, there are four in the R output, so they should be escaped properly.

@hadley
Copy link
Member

hadley commented Oct 8, 2013

The exact form of the path is super important - can you please just replace each directory name with a random string?

@SimonHStats
Copy link
Author

.libPaths()
[1] "\\thiscompany.office/personal/userdata-Inthistown/simon.hayward/Documents/R/win-library/3.0"
[2] "C:/Program Files/R/R-3.0.1/library"

I've added extra backslashes at the beginning of the string so it now appears exactly as I see it in RStudio.

Thanks Hadley.

@hadley
Copy link
Member

hadley commented Oct 8, 2013

That's a network shared drive? How are you setting your lib paths?

@SimonHStats
Copy link
Author

Yes, the top one is shared. If I try to write to the local drive (by deleting the network drive as a libPath) I get

"Warning in install.packages(deps, dependencies = dependencies) :
'lib = "C:/Program Files/R/R-3.0.1/library"' is not writable"

So the shared drive library was set by default when I tried to install a package and it couldn't install on the C drive with R (if I recall correctly), so it created another library elsewhere. Maybe I need to speak to a sysadmin about getting write permission for the C: drive and that make allow the installation?

I don't know why install_github wouldn't just write to the library on the shared drive as install.packages has been doing, but then again I don't really know enough to fix this kind of issue when it arises.

@hadley
Copy link
Member

hadley commented Oct 8, 2013

I doubt the write permissions are the issue - I'm just trying to figure out what's going wrong.

Does install.packages() work?

@SimonHStats
Copy link
Author

Yes, here's me installing ggmap for example, just now

install.packages("ggmap")
Installing package into ‘\this.office/personal/UserData-thistown/simon.hayward/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.0/ggmap_2.3.zip'
Content type 'application/zip' length 4529269 bytes (4.3 Mb)
opened URL
downloaded 4.3 Mb

@SimonHStats
Copy link
Author

Odd that it tells me 'lib' is unspecified, yet .libPaths() gives me two paths to libraries.

@hadley
Copy link
Member

hadley commented Oct 8, 2013

Could you please try installing the latest devel version by downloading https://dl.dropboxusercontent.com/u/41902/devtools_1.3.99.zip and then installing from a local zip file from within R?

@SimonHStats
Copy link
Author

Managed it to install it ok on my home computer, which has a very similar stack. So must be that it can't write to the local library, and the shared network folder is a problem. Github has complained when I tried to use that for my repository before.

I will send the new version to myself at work (I'm at home now), to try tomorrow. Thanks for the continued help.

@SimonHStats
Copy link
Author

Still no luck on my work machine with version 1.3.99 of devtools, still the same error when I try to use install_github.

I did get the following warning when installing devtools

"Warning in install.packages :
package ‘//this.office/personal/UserData-thisTown/simon.hayward/Downloads/devtools_1.3.99.zip’ is not available (for R version 3.0.1)"

But it seems to have installed ok, and the version in my library on the network drive is 1.3.99 according to the decription file.

I'm going to ask the sys admins if I there's a way that I can have my R library on the C: drive, it seems a ludicrous restriction that R can't save packages there.

@SimonHStats
Copy link
Author

I'm now pretty sure that this is an issue with 1. The C drive and my needing admin privileges to write to it. I don't know how I would invoke those privileges within R or R studio. 2. So, R is using a local library on the network shared drive for my other packages, but I think github is sulking because of the \ at the beginning of the network drive filepath, so between the two issues, I'm unable to use install_github :(

@hadley
Copy link
Member

hadley commented Oct 11, 2013

Can you please confirm the output of .libPaths() has four slashes but the path printed out by install_github (after --library) only has two slashes?

@hadley
Copy link
Member

hadley commented Oct 11, 2013

And if so, could you try changing your .libPath() to use // and see if that works with devtools?

@SimonHStats
Copy link
Author

No joy, the error message states

Error in C("/this.office/personal/UserData-thistown/simon.hayward/Documents/R/win-library/3.0", :
object not interpretable as a factor

Again GitHub has eaten one of the forward slashes. Yes the R output has 4 backslashes in the first part of the .libPath() output.

Is there anyway for devtools to install from a local zip file? I've tried installing 'rga' from a local zip (using install.packages) but R tells me that it isn't a valid package, (since it is still under development).

Further: I need admin privileges to write to the C: drive on my computer. I've tried running RStudio as an admin but it still won't write to the C: drive. Is there anyway I could pass elevated privileges to install_github?

@SimonHStats
Copy link
Author

Right, I'm a fool.

I changed to .libPaths("//this.office/personal/UserData-thistown/simon.hayward/Documents/R/win-library/3.0") succesfully, but now my error message is as follows:-

  • installing source package 'rga' ...
    ** R
    ** preparing package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** testing if installed package can be loaded
    *** arch - i386
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
    there is no package called 'rga'
    Error: loading failed
    Execution halted
    *** arch - x64
    Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
    there is no package called 'rga'
    Error: loading failed
    Execution halted
    ERROR: loading failed for 'i386', 'x64'
  • removing '\this.office/personal/UserData-thistown/simon.hayward/Documents/R/win-library/3.0/rga'
    Error: Command failed (1)

Which is at least different to what I had before! :)

@SimonHStats
Copy link
Author

The output of .libPaths() still has the 4 backslashes, although it seemed to change succesfully. Should have checked more carefully.

@hadley
Copy link
Member

hadley commented Oct 11, 2013

Another idea - can you bind that network address to a drive letter? Then try setting .libPaths() without any // or \\\\

@SimonHStats
Copy link
Author

Yes, that's a good idea, I'll have to speak to the senior sysadmin on Monday, rather than monkeying with registry entries!

Thanks Hadley you're a good man and thorough. Have a good weekend.

@SimonHStats
Copy link
Author

Yes! It worked! (Also it's easier now to map a drive to a letter than it used to be).

Thanks a bunch Professor!

@xianyongyin
Copy link

Hi Simon,

How did you solve this problem? I have an identical problem when I was trying to install a package from github using install_github into a share disc.

@lock
Copy link

lock bot commented Sep 18, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants