R-ArcGIS / r-bridge-install

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

Red X issue #100

Closed coolsheets closed 3 years ago

coolsheets commented 3 years ago

I wish to load the bridge and have run into the same issue as some previous users. The R Integration.pyt shows with a red x in catalog. ArcGIS Desktop 10.8.1.14362, with 64 bit background geoprocessing, R x64 4.1.0 image

orhuna commented 3 years ago

@coolsheets I believe with the background 64-bit, this is what you are referring to.

Did you try using this toolbox with a 32 bit R version? We do run into issues when using 64-bit R inside the ArcGIS Desktop.

coolsheets commented 3 years ago

That is correct. How do I tell ArcGIS to use the 32-bit version of R? Do I have to uninstall the 64-bit R?

coolsheets commented 3 years ago

Here are the Python log: Traceback (most recent call last): File "", line 8, in File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools__init__.py", line 17, in from .install_package import install_package File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\install_package.py", line 45, in PACKAGE_VERSION = r_pkg_version() File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\rpath.py", line 494, in r_pkg_version r_package_path = r_pkg_path() File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\rpath.py", line 473, in r_pkg_path for lib_path in r_all_lib_paths(): File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\rpath.py", line 397, in r_all_lib_paths r_user_library_path = r_user_lib_path() File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\rpath.py", line 378, in r_user_lib_path if r_version(): File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\rpath.py", line 360, in r_version r_version = r_reg_value("Current Version") File "C:\Program Files (x86)\ArcGIS\r-bridge-install-master\rtools\rpath.py", line 212, in r_reg_value _user_hive(getpass.getuser()), r_path) File "C:\Python27\ArcGIS10.8\Lib\getpass.py", line 157, in getuser import pwd ImportError: No module named pwd

scdub commented 3 years ago

It looks like the getuser call will try the environment variables LOGNAME, USER, LNAME and USERNAME for your username, and none of them look to be set. After that, it falls back to trying to run import pwd which isn't present on Windows. We can change the code to fix this, but for expediency, you might want to open a Command Prompt session, and type setx USERNAME coolsheets where coolsheets is replaced by the username you log into your machine with.

coolsheets commented 3 years ago

That worked Thank you! Command in Windows is setx USERNAME coolsheets No =

scdub commented 3 years ago

@coolsheets glad it worked! Thanks for the catch, fixed the command.