R-ArcGIS / r-bridge-install

Install the R ArcGIS Tools
Apache License 2.0
188 stars 59 forks source link

Installation not working #26

Closed fpfr closed 8 years ago

fpfr commented 8 years ago

Following the instructions for offline-installation on ArcGIS 10.4 with Administrator privileges on a machine where R 3.2.0 is installed both as 32- and 64-bit-Version, I get a "successful" message,

Running script InstallBindings...
Found local copy of binding, installing from zip
Rcmd.exe INSTALL d:\temp\tmps0_kr6\arcgisbinding_1.0.0.119.zip
package 'arcgisbinding' successfully unpacked and MD5 sums checked
* installing to library 'D:/MyUserName/Home/R/win-library/3.2'
Completed script InstallBindings...

but when trying to run an R-Script, I am being told that I haven't installed the "ArcGIS R integration package"

*** Please install ArcGIS R integration package
Failed to execute (myScript).

When running "R Installation Details", I get the following message:

Running script RInstallDetails...
R (version 3.2.0), installed in: C:\Program Files\R\R-3.2.0
R packages will be installed into: C:\Program Files\R\R-3.2.0\library
All R package libraries detected: C:\Program Files\R\R-3.2.0\library
The ArcGIS R package is not installed. Use the 'Install R Bindings' tool to install them.
Completed script RInstallDetails...

Also, in the installation instructions, it says

If that doesn't work, the package directory, "arcgisbinding", that gets installed into the R folder (usually, C:\Users\Documents\R\win-library) into the requested place, C:\Program Files (x86)\ArcGIS\Desktop\Rintegration

which is a) unclear as a verb is missing (copy?) and b) I don't have a directory C:\Program Files (x86)\ArcGIS\Desktop. It is called "C:\Program Files (x86)\ArcGIS\Desktop10.4". Is that of importance?

Any ideas?

scw commented 8 years ago

Hello @fpfr,

Thanks for the issue report. It looks like the current script doesn't automatically detect the Users' directory when it's installed on a different drive (it defaults to checking the windows value of CSIDL_PROFILE). Could you run this script:

https://gist.github.com/scw/59783c7720a73148362f71149d1ebd77

And print out the results? My guess is, R does more checks than we currently do, and I can emulate the full behavior to find the Users directory on another drive.

Thanks, Shaun

fpfr commented 8 years ago

Hello Shaun,

what do you mean with

doesn't automatically detect the Users' directory when it's installed on a different drive

All is installed on C:\, however, in different sub-directories. Now, thinking about it: I have a system variable %HOME% which points to "D:/MyUserName/Home" where "MyUserName" is not the user name of the user logged in. The script "InstallBindings" somehow seems to honor %HOME% and things get messed up ...

Anyway, I ran your new script with "Admininstrator" privileges and got the following

CSIDL_PROFILE + Documents: C:\Users\User\Documents
CSIDL_PERSONAL: C:\Users\User\Documents
HOMEDRIVE + HOMEPATH + Documents: C:\Users\User\Documents

running the Script as User, I got the same

CSIDL_PROFILE + Documents: C:\Users\User\Documents
CSIDL_PERSONAL: C:\Users\User\Documents
HOMEDRIVE + HOMEPATH + Documents: C:\Users\User\Documents

Hope this helps ...

scw commented 8 years ago

Hello @fpfr,

Great, thanks for the details. When the InstallBindings script runs, it uses R to actually do the installation. As you figured out, R picks up the %HOME variable and installs the package into that location. I've applied a fix in ffdc013012b6e4ed605e196aac5e2e91b3298ed7 to detect the value of HOME and check for the package there, could you see if this change works for you by redownloading the ZIP or pulling the current repository?

Cheers, Shaun

fpfr commented 8 years ago

Hello Shaun, thanks for the effort, but unfortunately, no success. I stil get

*** Please install ArcGIS R integration package
Failed to execute (myScript).

Here is the output of InstallBindings

Found local copy of binding, installing from zip
Rcmd.exe INSTALL d:\temp\tmpzcg4qo\arcgisbinding_1.0.0.119.zip
package 'arcgisbinding' successfully unpacked and MD5 sums checked
* installing to library 'D:/myUserName/Home/R/win-library/3.2'
Completed script InstallBindings...

And RInstallDetails

R (version 3.2.0), installed in: C:\Program Files\R\R-3.2.0
R packages will be installed into: D:\myUserName\Home\R\win-library\3.2
All R package libraries detected: D:\myUserName\Home\R\win-library\3.2;C:\Program Files\R\R-3.2.0\library
The ArcGIS R package (version 1.0.0.119) is installed at: D:\myUserName\Home\R\win-library\3.2\arcgisbinding

And finally the output of "documents_home.py"

CSIDL_PROFILE + Documents: C:\Users\User\Documents
CSIDL_PERSONAL: C:\Users\User\Documents
HOMEDRIVE + HOMEPATH + Documents: C:\Users\User\Documents

Best regards

scw commented 8 years ago

Ah, I see. Yes, the fix will allow you to install and use the bridge from R, but still not from ArcGIS (to run R-based Geoprocessing scripts). This code isn't something I can easily update, but there are a few possible work-arounds, here are two that should work without a great deal of effort:

  1. The easiest thing to do is to just copy the arcgisbinding package into the R installation library directory, so locate the D:/myUserName/Home/R/win-library/3.2/arcgisbinding directory, and copy that into C:/Program Files/R/R-3.2.0/library. This will require administrator privileges.
  2. Another option is to unset the %HOME% variable, and the bridge will be installed into a standard location instead of in a location ArcGIS isn't currently configured to check. If you do so, you may need to copy other packages you have installed from `D:/myUserName/Home/R/win-library/3.2 into one of the other locations R is checking for packages, or reinstall these packages and R will place them into the correct location.

If neither of these work or are easy to do, I can mention some other approaches we can use.

Cheers, Shaun

fpfr commented 8 years ago

OK, work-around 1) did the trick. Thank you very much for your help! BTW: Will someone sometime fix the issue of the installation?

scw commented 8 years ago

Great, glad that worked! Will mark this closed, but feel free to reopen if issues pop up.

This package handles the installation so that R can see it — the piece which detects the R package is within ArcGIS, so we can fix it for future releases but not easily for existing releases.