Error when trying to use r libraries on Jupyter notebook

768
2
Jump to solution
12-16-2020 11:21 PM
ShiloShiff
New Contributor II

Hi,

I'm trying to run a Jupyter notebook that uses r libraries. this is the error message:

image (1).png

 

 

 

 

 
<module>
     14 import itertools
     15 from datetime import datetime
---> 16 import rpy2.rinterface as rinterface
     17 import rpy2.rlike.container as rlc
     18 

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\rpy2\rinterface\__init__.py in <module>
     44 
     45 if sys.platform == 'win32':
---> 46     _load_r_dll(R_HOME)
     47 
     48 # cleanup the namespace

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\rpy2\rinterface\__init__.py in _load_r_dll(r_home)
     28     if r_bin not in os.environ.get('PATH'):
     29         os.environ['PATH'] = ';'.join((os.environ.get('PATH'), r_bin, r_mod))
---> 30     ctypes.CDLL(r_dll)
     31 
     32 R_HOME = get_r_home()

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    346 
    347         if handle is None:
--> 348             self._handle = _dlopen(self._name, mode)
    349         else:
    350             self._handle = handle

OSError: [WinError 127] The specified procedure could not be found

 I also tried to open R notebook through Jupyter Lab, but all I have there is a python notebook.

Screenshot 2020-12-17 092015.png

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor
0 Kudos
ShiloShiff
New Contributor II

Thank you Dan, I followed the instructions in your links without any result, then I started from scratch in a different machine (with r 4.0.0 instead of 4.0.3) and it works. I just followed these steps: 

  1. Install R (CRAN). 
  2. Set up R-ArcGIS Bridge using the geoprocessing tab in the Options dialog box.
  3. Install the package space-time-learn-lesson using the Python Package Manager in Pro.
0 Kudos