R-ArcGIS / r-bridge

Bridge library to connect ArcGIS and R, including arcgisbinding R library.
Apache License 2.0
118 stars 26 forks source link

R session terminates when calling arc.open() #57

Closed DEHodgson closed 3 years ago

DEHodgson commented 3 years ago

I'm trying to use the ArcGISPro 2.7.3 miniconda environment management to set up an R environment for use with the R-bridge When calling arc.open(...) the program terminates. I've tried with both standard and admin users.

conda create --clone arcgispro-py3 --name arcgis-r
activate arcgis-r
conda install r r-base r-essentials

I verify that the arcgis-r environment is active in ArcGISpro Using options > geoprocessing I select the R home directory (R=3.6.1) I install the arcgisbinding from the internet (1.0.1.244)

I Then call Rgui

library(arcgisbinding)
arc.check_product()
      product: ArcGIS Pro (12.7.3.26828)
      license: Advanced
      version: 1.0.1.244

fc <- arc.open(system.file("extdata", "ca_ozone_pts.shp", package="arcgisbinding"))

Seesion terminates -- Rgui disappears and I start again. If anyone has any idea as to what's going on I'd appreciate the help

orhuna commented 3 years ago

@DEHodgson you need :

conda create --clone arcgispro-py3 --name arcgis-r
activate arcgis-r
conda install r-arcgis-essentials

You are getting a silent crash because r-arcgis-essentials is built on mro3.5.3 and not r-base.

r-arcgis-essentials installs R (MRO 3.5.3) out of the box. The Conda command above will do the trick.

Please make sure to delete the previous Conda environment from %LOCALAPPDATA%\ESRI\conda\envs if you are going to use the same Conda environment name (arcgis-r)

DEHodgson commented 3 years ago

@orhuna That's great knowledge. Thanks for your help with this. I've scrubbed my initial environment and reset using your notes above conda create --clone arcgispro-py3 --name arcgis-r activate arcgis-r conda install r-arcgis-essentials

Sadly I'm seeing the same behaviour. Event Viewer is showing an application error for Rgui with faulting module name: KERNELBASE.dll

orhuna commented 3 years ago

@DEHodgson sorry to read that the issue persists.

In the Conda screen (Python Command Prompt), after making sure arcgis-r is the active environment, please launch the RGui.

Do you see license being checked out when you run the following:?

library(arcgisbinding)
arc.check_product()

If you see the crash again after the arc.open step, can you please run regsvr32 KERNELBASE.dll in the CMD and restart your computer. Please retry the steps above to see if the issue persists.

DEHodgson commented 3 years ago

Hey
I'm still getting the crash at arc.open I’ve run Deployment Image Servicing and Management tool to scan the machine with no issues and System File Checker which again found no issues. De / Re-registering it and it threw this error. The module "kernelbase.dll" was loaded but the entry-point DllRegisterServer was not found. Make sure that "kernelbase.dll" is a valid DLL or OCX file and then try again. I've verify the process on a separate machine and the environment creation and arcgisbinding install and use is successful. This issue seems specific to the machine that I'm running this on so not really your problem. Thank you for your help

orhuna commented 3 years ago

Thanks for the update @DEHodgson . Yes, kernel dll issues generally point to a corrupt OS file. I believe Microsoft offers tools that rebuilds them.