我想在python中使用R。我通过conda install -c r rpy2
安装rpy2。但是,当我导入robjects时,出现了错误的Unable to locate R.dll at 'C:\Program Files\R\R-3.5.1\bin\x64\R.dll'
。在我的计算机中,R已安装在D:\R\R-3.5.1
我想将D:\R\R-3.5.3
,D:\R\R-3.5.3\bin
和D:\R\R-3.5.3\bin\x64
添加到我的路径,但这没有用。我对为什么隐含C:\Program Files\R\R-3.5.1\bin\x64\R.dll
感到困惑,因为我的R安装在D:\R\R-3.5.1
这是错误列表
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\Anaconda3\lib\site-packages\rpy2-2.9.4-py3.7-win-amd64.egg\rpy2\robjects\__init__.py", line 16, in <module>
import rpy2.rinterface as rinterface
File "D:\Anaconda3\lib\site-packages\rpy2-2.9.4-py3.7-win-amd64.egg\rpy2\rinterface\__init__.py", line 46, in <module>
_load_r_dll(R_HOME)
File "D:\Anaconda3\lib\site-packages\rpy2-2.9.4-py3.7-win-amd64.egg\rpy2\rinterface\__init__.py", line 27, in _load_r_dll
raise RuntimeError("Unable to locate R.dll at %s" % r_dll)
RuntimeError: Unable to locate R.dll at C:\Program Files\R\R-3.5.1\bin\x64\R.dll
我希望有人能帮助我。