python - Rpy2 Cannot Find R.dll -
i on windows 7 64bit python 2.7.9, have installed r-3.2.0 (also tried r-2.12.2 , r-3.1.3 got same result), added c:\program files\r\r-3.2.0\bin\i386
system path, added r_home system variable value c:\program files\r\r-3.2.0
, added r_user value "matt", , installed rpy2-2.3.0dev .exe file, installed.
however, typing from rpy2 import robjects
gives following error in rpy2\rinterface\__init__.py:
traceback (most recent call last): file "c:\python27\rpy2test.py", line 2, in <module> rpy2 import robjects file "c:\python27\lib\site-packages\rpy2\robjects\__init__.py", line 14, in <module> import rpy2.rinterface rinterface file "c:\python27\lib\site-packages\rpy2\rinterface\__init__.py", line 79, in <module> raise runtimeerror("unable locate r.dll within %s" % r_home) runtimeerror: unable locate r.dll within c:program files\r\r-3.2.0
i have tried copying , pasting this:
if os.path.exists(os.path.join(r_home, 'lib')): ## added ## os.environ['path'] += ';' + os.path.join(r_home, 'bin') ## added ## os.environ['path'] += ';' + os.path.join(r_home, 'modules') ## added ## os.environ['path'] += ';' + os.path.join(r_home, 'lib') ## added ## else: ## added ## os.environ['path'] += ';' + os.path.join(r_home, 'bin', 'i386') ## added ## os.environ['path'] += ';' + os.path.join(r_home, 'modules', 'i386') ## added ## os.environ['path'] += ';' + os.path.join(r_home, 'library') ## added ## # load r dll using explicit path # first try bin dir: rlib = os.path.join(r_home, 'bin', 'r.dll') # try bin/i386 subdirectory seen in r 2.12.0 ## added ## if not os.path.exists(rlib): ## added ## rlib = os.path.join(r_home, 'bin', 'i386', 'r.dll') ## added ##
into rinterface\__init__.py, did nothing.
i have tried copying bin\i386 folder bin folder, still makes no difference.
how rpy2 find r.dll?
last night made rpy2 install pdf addresses issue -- either r, pyhton, pywin32 or rpy2 linked in path not 32-bit.
maybe - rpy2pandas.pdf
(only thing have python in c:/python27/arcgis10.2/python.exe, otherwise else should port.)
Comments
Post a Comment