3

I am importing rpy2.robjects and receiving following error on executing python code in spyder IDE : File "C:\ProgramData\Anaconda33\lib\site-packages\rpy2\rinterface_lib\openrlib.py", line 37, in _dlopen_rlib rlib = ffi.dlopen(lib_path)

OSError: cannot load library 'C:\ProgramData\R\R-4.0.2\bin\x64\R.dll': error 0x7e

I have R installed and R_HOME, R_USER env variables set, also it workes till import rpy2, error occurs on importing rpy2.robjects.

Using Anaconda3-2020.02 having python version 3.7.6 and rpy2 version 3.3.4

python -m rpy2.situation yields following error : enter image description here

Env variables value : enter image description here

any help with this will be appreciated.

i have tried to run same on pycharm by creating virtual env using native python 3.8 interpreter and pip installing rpy2 on it, getting same error with that too. enter image description here

Rishabh Tyagi
  • 81
  • 1
  • 7
  • Possible duplicate of https://stackoverflow.com/questions/29863535/rpy2-cannot-find-r-dll ? – ewokx Jul 02 '20 at 09:40
  • it suggests to use 32bit R , have already tried it, doesn't work. possibly the error is in openrlib.py when it tries 'rlib = ffi.dlopen(lib_path)' the lib_path here is not the same as here R.dll resides on my machine. – Rishabh Tyagi Jul 02 '20 at 10:31
  • 1
    Does this answer your question? [OSError: cannot load library 'C:\Program Files\R\R-4.0.2\bin\x64\R.dll': error 0x7e](https://stackoverflow.com/questions/63863449/oserror-cannot-load-library-c-program-files-r-r-4-0-2-bin-x64-r-dll-error-0) – Bruno Gabuzomeu Sep 25 '20 at 07:29

0 Answers0